Commit 14c9feb8 by tyfanchz

增加获取字典集接口

1 parent 59e56ded
package com.glsx.admin.controller;
import java.util.List;
import com.alibaba.fastjson.JSON;
import com.glsx.admin.pojo.request.SysCodeReq;
import com.glsx.admin.pojo.response.SysCodeResp;
import com.glsx.admin.remote.SysCodeFeignClient;
import com.glsx.plat.core.web.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>Description: 字典集业务
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-24
*/
@Slf4j
@RestController
@RequestMapping("/sysCode")
public class SysCodeController {
@Autowired
private SysCodeFeignClient sysCodeFeignClient;
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public R getList(SysCodeReq req) {
log.info("$$$$ /sysCode/getList param: {}", JSON.toJSONString(req));
List<SysCodeResp> respList = sysCodeFeignClient.getListByCondition(req);
return R.ok().data(respList);
}
}
package com.glsx.admin.pojo.request;
import lombok.Data;
/**
* 车家智能系统代码集表
*/
@Data
public class SysCodeReq {
/**
* 标识ID
*/
private Long id;
/**
* 字典类型
*/
private String dictType;
/**
* 字典键值
*/
private String dictKey;
/**
* 字典值
*/
private String dictValue;
/**
* 父级键值
*/
private String parentKey;
/**
* 排序
*/
private Byte sort;
/**
* 状态:0下线 1上线
*/
private Byte status;
/**
* 分级
*/
private Byte level;
}
package com.glsx.admin.pojo.response;
import java.util.Date;
import lombok.Data;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-15
*/
/**
* 车家智能系统代码集表
*/
@Data
public class SysCodeResp {
/**
* 标识ID
*/
private Long id;
/**
* 字典类型
*/
private String dictType;
/**
* 字典键值
*/
private String dictKey;
/**
* 字典值
*/
private String dictValue;
/**
* 父级键值
*/
private String parentKey;
/**
* 排序
*/
private Byte sort;
/**
* 状态:0下线 1上线
*/
private Byte status;
/**
* 分级
*/
private Byte level;
/**
* 备注
*/
private String remark;
/**
* 创建时间
*/
private Date createTime;
/**
* 创建人
*/
private Long createBy;
/**
* 更新时间
*/
private Date updateTime;
/**
* 更新人
*/
private Long updateBy;
}
package com.glsx.admin.remote;
import java.util.List;
import com.glsx.admin.pojo.request.SysCodeReq;
import com.glsx.admin.pojo.response.SysCodeResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author think.wang
* @date 2021-03-16
*/
@FeignClient(name = "${feign.server.name}",url = "${feign.server.url}")
public interface SysCodeFeignClient {
@ResponseBody
@RequestMapping(value = "/sysCode/getListByCondition", method = {RequestMethod.POST})
List<SysCodeResp> getListByCondition(@RequestBody SysCodeReq req);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!