|
|
|
package com.glxp.api.controller.thrsys;
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
import com.glxp.api.annotation.Log;
|
|
|
|
import com.glxp.api.constant.BusinessType;
|
|
|
|
import com.glxp.api.entity.system.ThirdSysApiEntity;
|
|
|
|
import com.glxp.api.req.system.FilterSysApiRequest;
|
|
|
|
import com.glxp.api.res.PageSimpleResponse;
|
|
|
|
import com.glxp.api.service.system.ThirdSysApiService;
|
|
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
public class ThirdSysApiController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
private ThirdSysApiService thirdSysApiService;
|
|
|
|
|
|
|
|
@GetMapping("/sys/api/findAll")
|
|
|
|
public BaseResponse findAll(FilterSysApiRequest filterSysApiRequest) {
|
|
|
|
List<ThirdSysApiEntity> thirdSysApiEntities = thirdSysApiService.findSysApi(filterSysApiRequest);
|
|
|
|
PageInfo<ThirdSysApiEntity> pageInfo;
|
|
|
|
pageInfo = new PageInfo<>(thirdSysApiEntities);
|
|
|
|
PageSimpleResponse<ThirdSysApiEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
|
|
|
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
|
|
|
pageSimpleResponse.setList(thirdSysApiEntities);
|
|
|
|
return ResultVOUtils.success(pageSimpleResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/sys/api/modifyApi")
|
|
|
|
@Log(title = "第三方api", businessType = BusinessType.UPDATE)
|
|
|
|
public BaseResponse modifyApi(@RequestBody ThirdSysApiEntity thirdSysApiEntity) {
|
|
|
|
|
|
|
|
boolean b = thirdSysApiService.modifySysApi(thirdSysApiEntity);
|
|
|
|
if (b)
|
|
|
|
return ResultVOUtils.success("修改成功");
|
|
|
|
else
|
|
|
|
return ResultVOUtils.error(500, "修改失败");
|
|
|
|
}
|
|
|
|
}
|