|
|
@@ -0,0 +1,46 @@
|
|
|
+package com.hy.modules.bz.webapi.controller;
|
|
|
+
|
|
|
+import com.hy.common.web.base.BaseController;
|
|
|
+import com.hy.common.web.domain.response.Result;
|
|
|
+import com.hy.modules.bz.webapi.dto.LoginInfoDto;
|
|
|
+import com.hy.modules.bz.webapi.dto.LoginResultDto;
|
|
|
+import com.hy.modules.bz.webapi.dto.RankingDto;
|
|
|
+import com.hy.modules.bz.webapi.dto.RankingFetchDto;
|
|
|
+import com.hy.modules.bz.webapi.service.WebApiService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@Api(tags = {"星际战争"})
|
|
|
+@RequestMapping("/bz/api")
|
|
|
+public class BzWebApiController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private WebApiService apiService;
|
|
|
+
|
|
|
+ @RequestMapping("/login.json")
|
|
|
+ @ResponseBody
|
|
|
+ public Result<LoginResultDto> login(@RequestBody LoginInfoDto loginInfo) {
|
|
|
+ try{
|
|
|
+ return success(apiService.login(loginInfo));
|
|
|
+ }catch (Exception ex){
|
|
|
+ return failure(ex.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("/rankingList.json")
|
|
|
+ public Result<List<RankingDto>> rankingList(@RequestBody RankingFetchDto fetchDto) {
|
|
|
+ try{
|
|
|
+ return success(apiService.rankingList(fetchDto));
|
|
|
+ }catch (Exception ex){
|
|
|
+ return failure(ex.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|