Commit 25ae563e authored by 陈祥烨's avatar 陈祥烨

.

parent fd223103
package com.yeejoin.amos.api.tool.controller;
import com.yeejoin.amos.api.tool.face.model.Vo.ApiInfoVo;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import com.yeejoin.amos.api.tool.face.service.I_Impl.ApiInfoServiceImpl;
import com.yeejoin.amos.api.tool.face.service.I_Impl.ApiSourceServiceImpl;
import com.yeejoin.amos.api.tool.face.service.ApiInfoService;
import com.yeejoin.amos.api.tool.face.service.ApiSourceService;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.api.tool.face.model.Dto.ApiInfoDto;
import com.yeejoin.amos.api.tool.face.model.ApiInfoModel;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
@CrossOrigin
......@@ -24,9 +23,9 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
public class ApiInfoController{
@Autowired
ApiInfoServiceImpl apiInfoServiceImpl;
ApiInfoService apiInfoService;
@Autowired
ApiSourceServiceImpl apiSourceServiceImpl;
ApiSourceService apiSourceService;
/**
* 新增
......@@ -35,9 +34,9 @@ public class ApiInfoController{
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<ApiInfoVo> save(@RequestBody ApiInfoVo apiInfoVo) throws Exception {
apiInfoServiceImpl.insertApiInfo(apiInfoVo);
return ResponseHelper.buildResponse(apiInfoVo);
public ResponseModel<ApiInfoModel> save(@RequestBody ApiInfoModel apiInfoModel) throws Exception {
apiInfoService.insertApiInfo(apiInfoModel);
return ResponseHelper.buildResponse(apiInfoModel);
}
/**
......@@ -48,9 +47,9 @@ public class ApiInfoController{
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<ApiInfoDto> updateBySequenceNbrApiInfo(@RequestBody ApiInfoDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<ApiInfoModel> updateBySequenceNbrApiInfo(@RequestBody ApiInfoModel model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(apiInfoServiceImpl.updateWithModel(model));
return ResponseHelper.buildResponse(apiInfoService.updateWithModel(model));
}
/**
......@@ -62,7 +61,7 @@ public class ApiInfoController{
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(apiInfoServiceImpl.removeById(sequenceNbr));
return ResponseHelper.buildResponse(apiInfoService.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
......@@ -72,8 +71,8 @@ public class ApiInfoController{
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<ApiInfoVo> selectOne(@PathVariable Long sequenceNbr) throws Exception {
return ResponseHelper.buildResponse(apiInfoServiceImpl.selectApiInfoMsg(sequenceNbr));
public ResponseModel<ApiInfoModel> selectOne(@PathVariable Long sequenceNbr) throws Exception {
return ResponseHelper.buildResponse(apiInfoService.selectApiInfoMsg(sequenceNbr));
}
/**
* 列表分页查询
......@@ -84,13 +83,13 @@ public class ApiInfoController{
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<ApiInfoDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam(value = "size") int size,@RequestParam(value = "sequenceNbr") Long sequenceNbr)
public ResponseModel<Page<ApiInfoModel>> queryForPage(@RequestParam(value = "current") int current, @RequestParam(value = "size") int size, @RequestParam(value = "sequenceNbr") Long sequenceNbr)
{
Page<ApiInfoDto> page=new Page<ApiInfoDto>();
Page<ApiInfoModel> page=new Page<ApiInfoModel>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(apiInfoServiceImpl.queryForApiInfoPage(page,apiSourceServiceImpl.queryCodeById(sequenceNbr)));
return ResponseHelper.buildResponse(apiInfoService.queryForApiInfoPage(page, apiSourceService.queryCodeById(sequenceNbr)));
}
/**
*列表全部数据查询
......@@ -99,8 +98,8 @@ public class ApiInfoController{
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<ApiInfoDto>> selectForList()
public ResponseModel<List<ApiInfoModel>> selectForList()
{
return ResponseHelper.buildResponse(apiInfoServiceImpl.queryForApiInfoList());
return ResponseHelper.buildResponse(apiInfoService.queryForApiInfoList());
}
}
package com.yeejoin.amos.api.tool.controller;
import com.yeejoin.amos.api.tool.face.model.Dto.ApiSourceDto;
import com.yeejoin.amos.api.tool.face.service.I_Impl.ApiSourceServiceImpl;
import com.yeejoin.amos.api.tool.face.model.ApiSourceModel;
import com.yeejoin.amos.api.tool.face.service.ApiSourceService;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
......@@ -24,7 +24,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
public class ApiSourceController {
@Autowired
ApiSourceServiceImpl apiSourceServiceImpl;
ApiSourceService apiSourceService;
/**
* 新增
......@@ -34,8 +34,8 @@ public class ApiSourceController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<ApiSourceDto> save(@RequestBody ApiSourceDto model) {
model = apiSourceServiceImpl.createWithModel(model);
public ResponseModel<ApiSourceModel> save(@RequestBody ApiSourceModel model) {
model = apiSourceService.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
......@@ -48,9 +48,9 @@ public class ApiSourceController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<ApiSourceDto> updateBySeqApiSource(@RequestBody ApiSourceDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
public ResponseModel<ApiSourceModel> updateBySeqApiSource(@RequestBody ApiSourceModel model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(apiSourceServiceImpl.updateWithModel(model));
return ResponseHelper.buildResponse(apiSourceService.updateWithModel(model));
}
/**
......@@ -63,7 +63,7 @@ public class ApiSourceController {
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(apiSourceServiceImpl.removeById(sequenceNbr));
return ResponseHelper.buildResponse(apiSourceService.removeById(sequenceNbr));
}
/**
......@@ -75,8 +75,8 @@ public class ApiSourceController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<ApiSourceDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(apiSourceServiceImpl.queryBySeq(sequenceNbr));
public ResponseModel<ApiSourceModel> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(apiSourceService.queryBySeq(sequenceNbr));
}
......@@ -88,8 +88,8 @@ public class ApiSourceController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET", value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<ApiSourceDto>> selectForList() {
return ResponseHelper.buildResponse(apiSourceServiceImpl.queryForApiSourceList());
public ResponseModel<List<ApiSourceModel>> selectForList() {
return ResponseHelper.buildResponse(apiSourceService.queryForApiSourceList());
}
}
package com.yeejoin.amos.api.tool.face.model.Dto;
package com.yeejoin.amos.api.tool.face.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "ApiInfoDto", description = "")
public class ApiInfoDto {
public class ApiInfoModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "物理主键")
private Long sequenceNbr;
@ApiModelProperty(value = "接口来源")
private String apiSource;
......@@ -37,9 +36,4 @@ public class ApiInfoDto {
@ApiModelProperty(value = "解析规则配置")
private String ruleData;
@ApiModelProperty(value = "更新时间")
protected Date recDate;
@ApiModelProperty(value = "更新人")
protected String recUserId;
}
package com.yeejoin.amos.api.tool.face.model.Dto;
package com.yeejoin.amos.api.tool.face.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.typroject.tyboot.core.rdbms.model.BaseModel;
import java.util.Date;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="ApiSourceDto", description="")
public class ApiSourceDto {
public class ApiSourceModel extends BaseModel {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "物理主键")
private Long sequenceNbr;
@ApiModelProperty(value = "接口来源名称")
private String name;
......@@ -22,9 +22,5 @@ public class ApiSourceDto {
@ApiModelProperty(value = "接口标识")
private String code;
@ApiModelProperty(value = "更新时间")
protected Date recDate;
@ApiModelProperty(value = "更新人")
protected String recUserId;
}
package com.yeejoin.amos.api.tool.face.model.Vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class ApiInfoVo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "接口来源")
private String apiSource;
@ApiModelProperty(value = "接口名称")
private String apiName;
@ApiModelProperty(value = "接口方法")
private String httpMethod;
@ApiModelProperty(value = "接口地址")
private String apiPath;
@ApiModelProperty(value = "响应方式")
private String resType;
@ApiModelProperty(value = "请求参数配置")
private String bodyValue;
@ApiModelProperty(value = "解析规则配置")
private String ruleData;
@ApiModelProperty(value = "物理主键")
private Long sequenceNbr;
}
package com.yeejoin.amos.api.tool.face.orm.dao;
import org.apache.ibatis.annotations.Mapper;
/**
* MyBatis BaseMapper
* @author DELL
*/
@Mapper
public interface BaseMapper {
}
package com.yeejoin.amos.api.tool.face.orm.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 公共实体类
*
* @author DELL
*/
@Data
public class BaseEntity implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
@TableId(value = "sequence_nbr" , type = IdType.AUTO)
protected Long sequenceNbr;
@TableField(value = "rec_date",fill=FieldFill.INSERT_UPDATE )
protected Date recDate;
@TableField(value = "rec_user_id",fill=FieldFill.INSERT_UPDATE )
protected String recUserId;
/**
* 是否删除
*/
// @TableField(value = "is_delete")
// private Boolean isDelete;
}
package com.yeejoin.amos.api.tool.face.service.I_Impl;
package com.yeejoin.amos.api.tool.face.service;
import com.yeejoin.amos.api.tool.face.orm.entity.ApiInfo;
import com.yeejoin.amos.api.tool.face.orm.dao.ApiInfoMapper;
import com.yeejoin.amos.api.tool.face.service.I_Intf.IApiInfoService;
import com.yeejoin.amos.api.tool.face.model.Dto.ApiInfoDto;
import com.yeejoin.amos.api.tool.face.model.Vo.ApiInfoVo;
import com.yeejoin.amos.api.tool.face.model.ApiInfoModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -13,42 +11,40 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
@Service
public class ApiInfoServiceImpl extends BaseService<ApiInfoDto,ApiInfo,ApiInfoMapper> implements IApiInfoService{
public class ApiInfoService extends BaseService<ApiInfoModel,ApiInfo,ApiInfoMapper> {
@Autowired
ApiSourceServiceImpl apiSourceService;
ApiSourceService apiSourceService;
/**
* 分页查询
*/
public Page<ApiInfoDto> queryForApiInfoPage(Page<ApiInfoDto> page,String apiSource) {
public Page<ApiInfoModel> queryForApiInfoPage(Page<ApiInfoModel> page, String apiSource) {
return this.queryForPage(page, null, false, apiSource);
}
/**
* 列表查询 示例
*/
public List<ApiInfoDto> queryForApiInfoList() {
public List<ApiInfoModel> queryForApiInfoList() {
return this.queryForList("" , false);
}
@Override
public void insertApiInfo(ApiInfoVo apiInfoVo) throws Exception {
public void insertApiInfo(ApiInfoModel apiInfoModel) throws Exception {
ApiInfo apiInfo = new ApiInfo();
BeanUtils.copyProperties(apiInfoVo,apiInfo);
BeanUtils.copyProperties(apiInfoModel,apiInfo);
// 保存接口基本信息
this.save(apiInfo);
}
@Override
public ApiInfoVo selectApiInfoMsg(Long sequenceNbr) throws Exception {
public ApiInfoModel selectApiInfoMsg(Long sequenceNbr) throws Exception {
// 查询接口基本信息
ApiInfoDto apiInfoDto = this.queryBySeq(sequenceNbr);
ApiInfoVo apiInfoVo = new ApiInfoVo();
BeanUtils.copyProperties(apiInfoDto,apiInfoVo);
return apiInfoVo;
ApiInfoModel apiInfoModel = this.queryBySeq(sequenceNbr);
return apiInfoModel;
}
@Override
public void deleteApiInfo(Long sequenceNbr) throws Exception {
// 删除接口基本信息
this.deleteBySeq(sequenceNbr);
......@@ -56,11 +52,11 @@ public class ApiInfoServiceImpl extends BaseService<ApiInfoDto,ApiInfo,ApiInfoMa
ApiInfo apiInfo = this.getById(sequenceNbr);
}
@Override
public void updateApiInfo(ApiInfoVo apiInfoVo, Long sequenceNbr) throws Exception {
public void updateApiInfo(ApiInfoModel apiInfoModel, Long sequenceNbr) throws Exception {
// 更新接口基本信息
ApiInfo apiInfo = new ApiInfo();
BeanUtils.copyProperties(apiInfoVo,apiInfo);
BeanUtils.copyProperties(apiInfoModel,apiInfo);
this.updateById(apiInfo);
// 更新接口来源信息
......
package com.yeejoin.amos.api.tool.face.service.I_Impl;
package com.yeejoin.amos.api.tool.face.service;
import com.yeejoin.amos.api.tool.face.model.Dto.ApiSourceDto;
import com.yeejoin.amos.api.tool.face.model.ApiSourceModel;
import com.yeejoin.amos.api.tool.face.orm.entity.ApiSource;
import com.yeejoin.amos.api.tool.face.orm.dao.ApiSourceMapper;
import org.typroject.tyboot.core.rdbms.service.BaseService;
......@@ -9,18 +9,18 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ApiSourceServiceImpl extends BaseService<ApiSourceDto, ApiSource, ApiSourceMapper> {
public class ApiSourceService extends BaseService<ApiSourceModel, ApiSource, ApiSourceMapper> {
/**
* 列表查询 示例
*/
public List<ApiSourceDto> queryForApiSourceList() {
public List<ApiSourceModel> queryForApiSourceList() {
return this.queryForList("", false);
}
public String queryCodeById(Long sequenceNbr){
ApiSourceDto model = this.queryModelByParams(sequenceNbr);
ApiSourceModel model = this.queryModelByParams(sequenceNbr);
return model.getCode();
}
}
package com.yeejoin.amos.api.tool.face.service.I_Intf;
import com.yeejoin.amos.api.tool.face.model.Dto.ApiInfoDto;
import com.yeejoin.amos.api.tool.face.model.Vo.ApiInfoVo;
import org.apache.ibatis.annotations.Param;
public interface IApiInfoService {
void insertApiInfo(ApiInfoVo apiInfoVo) throws Exception;
ApiInfoVo selectApiInfoMsg(@Param("sequenceNbr") Long sequenceNbr) throws Exception;
// ApiInfoDto selectApiInfo(@Param("apiSource") String apiSource) throws Exception;
void deleteApiInfo (@Param("sequenceNbr") Long sequenceNbr) throws Exception;
void updateApiInfo (ApiInfoVo apiInfoVo, Long sequenceNbr) throws Exception;
}
package com.yeejoin.amos.api.tool.face.service.I_Intf;
public interface IApiSourceService {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment