Commit 9c25f8fc by shenweidong

完成了警员的相关增删改查接口

parent 94dc3d78
......@@ -7,12 +7,11 @@
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="jyzb-process" />
<module name="jyzb-common" />
<module name="jyzb-boot" />
<module name="jyzb-api" />
<module name="jyzb-boot" />
<module name="jyzb-biz" />
<module name="jyzb-business" />
<module name="jyzb-process" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
......
......@@ -6,8 +6,6 @@
<file url="file://$PROJECT_DIR$/jyzb-biz/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-boot/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-boot/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-business/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-business/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/jyzb-process/src/main/java" charset="UTF-8" />
......
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<Languages>
<language minSize="203" name="Java" />
</Languages>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/jyzb-business/jyzb-business.iml" filepath="$PROJECT_DIR$/jyzb-business/jyzb-business.iml" />
</modules>
</component>
</project>
\ No newline at end of file
package com.junmp.jyzb.api.bean.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
@ApiModel(value="com-junmp-jyzb-domain-Policeman")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Policeman implements Serializable {
/**
* 警员id
*/
@ApiModelProperty(value="警员id")
private String id;
/**
* 警员名称
*/
@ApiModelProperty(value="警员名称")
private String name;
/**
* 单警柜关联id
*/
@ApiModelProperty(value="单警柜关联id")
private String cabinetId;
/**
* 机构代码,一个警员只属于一个机构
*/
@ApiModelProperty(value="机构代码,一个警员只属于一个机构")
private String orgId;
/**
* 警员编号
*/
@ApiModelProperty(value="警员编号")
private String policeCode;
/**
* 警员性别
*/
@ApiModelProperty(value="警员性别")
private String sex;
/**
* 警员照片
*/
@ApiModelProperty(value="警员照片")
private String photo;
/**
* 联系方式
*/
@ApiModelProperty(value="联系方式")
private String phone;
/**
* 创建时间
*/
@ApiModelProperty(value="创建时间")
private Date createTime;
/**
* 最后更新时间
*/
@ApiModelProperty(value="最后更新时间")
private Date updateTime;
/**
* 更新人员
*/
@ApiModelProperty(value="更新人员")
private String updateUser;
/**
* 软删除,0表存在,1表已删除
*/
@ApiModelProperty(value="软删除,0表存在,1表已删除")
private Integer existType;
/**
* 人脸信息
*/
@ApiModelProperty(value="人脸信息")
private String faceInfo;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.junmp.jyzb.controller;
import com.junmp.jyzb.domain.PoliceFinger;
import com.junmp.jyzb.domain.Policeman;
import com.junmp.jyzb.service.PoliceFingerService;
import com.junmp.jyzb.service.PolicemanService;
......@@ -8,7 +7,6 @@ import com.junmp.jyzb.utils.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -19,7 +17,7 @@ import java.util.Map;
@RestController
@Slf4j
@RequestMapping("/police")
@RequestMapping("/Police")
@Api(tags = "警员基础信息模块")
public class PoliceController {
......@@ -29,22 +27,59 @@ public class PoliceController {
@Resource
private PoliceFingerService fingerService;
@PostMapping("/getAllPoliceman")
@PostMapping("/GetAllPolice")
@ApiOperation("查询警员列表")
public ResponseResult getAllPoliceman(){
List<Policeman> allPoliceman = policemanService.getAllPoliceman();
public ResponseResult getAllPoliceman(@RequestBody Map<String, Object> orgId){
//获取该组织机构下所有警员的id
List<Map<String, Object>> allPoliceman=new ArrayList<>();
List<String> allPoliceId =policemanService.getAllPoliceId(orgId);
for (String policeId :allPoliceId){
Map<String, Object> policeMsg = policemanService.getOnePolice(policeId);
List<Map<String, Object>> fingerprints= fingerService.getFingersByUserId(policeId);
policeMsg.put("fingerMsg",fingerprints);
allPoliceman.add(policeMsg);
}
return new ResponseResult(10000,"操作成功",allPoliceman);
}
@PostMapping("/getOnePolice")
@PostMapping("/GetOnePolice")
@ApiOperation("查询单个警员信息")
public ResponseResult getFingerprintsByUserId(@RequestBody Map<String, Object> msg) {
public ResponseResult getOnePolice(@RequestBody Map<String, Object> msg) {
String userId = msg.get("policeId").toString();
Map<String, Object> policeMsg = policemanService.getPoliceMsg(userId);
Map<String, Object> policeMsg = policemanService.getOnePolice(userId);
List<Map<String, Object>> fingerprints = fingerService.getFingersByUserId(userId);
policeMsg.put("fingerMsg",fingerprints);
return new ResponseResult(10000,"操作成功",policeMsg);
}
@PostMapping("/AddPoliceman")
@ApiOperation("添加警员信息")
public ResponseResult addPoliceman(@RequestBody Map<String,Object> msg) {
policemanService.addPoliceman(msg);
return new ResponseResult(10000,"操作成功");
}
@PostMapping("/DeletePolice")
@ApiOperation("删除警员信息")
public ResponseResult deletePolice(@RequestBody Map<String,Object> msg) {
policemanService.deletePolice(msg);
return new ResponseResult(10000,"操作成功");
}
@PostMapping("/UpdatePolice")
@ApiOperation("修改警员信息")
public ResponseResult updatePolice(@RequestBody Map<String,Object> msg) {
policemanService.updatePolice(msg);
return new ResponseResult(10000,"操作成功");
}
@PostMapping("/DeletePoliceFinger")
@ApiOperation("删除警员指纹信息")
public ResponseResult deletePoliceFinger(@RequestBody Map<String,Object> msg) {
policemanService.deleteFinger(msg);
return new ResponseResult(10000,"操作成功");
}
}
......@@ -26,6 +26,12 @@ public class PoliceFinger implements Serializable {
private String policeId;
/**
* 指纹名称
*/
@ApiModelProperty(value = "警员id")
private String name;
/**
* 指纹信息
*/
@ApiModelProperty(value = "指纹信息")
......
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......@@ -91,5 +93,10 @@ public class Policeman implements Serializable {
@ApiModelProperty(value="人脸信息")
private String faceInfo;
/**
* 指纹信息
* */
private List<PoliceFinger> fingerMsg;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
package com.junmp.jyzb.mapper;
import com.junmp.jyzb.domain.PoliceFinger;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
......@@ -10,4 +11,8 @@ import java.util.Map;
public interface PoliceFingerMapper {
List<Map<String, Object>> getFingersByUserId(String userId);
void addFingers(PoliceFinger fingers);
void updateFingers(PoliceFinger finger);
}
\ No newline at end of file
......@@ -17,15 +17,18 @@ public interface PolicemanMapper extends BaseMapper<Policeman> {
/**
* 查询警员列表
*/
public List<Policeman> getAllPoliceman();
public List<Map<String, Object>> getAllPoliceman(String orgId);
/**
* 查询单个警员的信息
*/
List getOnePolice(String id);
Map<String, Object> getOnePolice(String id);
/**
* 查询单个警员的信息
*/
Map<String, Object> getPoliceMsg(String userId);
void deletePolice(String id);
void updatePolice(Policeman police);
List<String> getAllPoliceId(String orgId);
void deleteFinger(String fingerId);
}
\ No newline at end of file
......@@ -7,14 +7,18 @@ import java.util.List;
import java.util.Map;
public interface PolicemanService{
ResponseResult addPoliceman(Policeman policeman);
List<Policeman> getAllPoliceman();
Map<String,Object> getOnePolice(String id);
void addPoliceman(Map<String, Object> msg);
/**
* 获取单个警员信息
* */
Map<String, Object> getPoliceMsg(String userId);
Map<String,Object> getOnePolice(String id);
void deletePolice(Map<String, Object> msg);
void updatePolice(Map<String, Object> msg);
List<String> getAllPoliceId(Map<String, Object> orgId);
void deleteFinger(Map<String, Object> msg);
}
package com.junmp.jyzb.service.impl;
import com.alibaba.fastjson2.util.DateUtils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.junmp.jyzb.domain.PoliceFinger;
import com.junmp.jyzb.mapper.PoliceFingerMapper;
import com.junmp.jyzb.mapper.PolicemanMapper;
import com.junmp.jyzb.service.PolicemanService;
import com.junmp.jyzb.utils.ResponseResult;
import com.junmp.jyzb.utils.DateTimeUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.junmp.jyzb.domain.Policeman;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class PolicemanServiceImpl implements PolicemanService {
......@@ -17,27 +21,102 @@ public class PolicemanServiceImpl implements PolicemanService {
@Autowired
private PolicemanMapper policemanMapper;
@Autowired
private PoliceFingerMapper policeFingerMapper;
@Override
public ResponseResult addPoliceman(Policeman policeman) {
//TODO 添加的逻辑代码
//policemanMapper.addPoliceman(policeman);
return new ResponseResult(200, "添加成功", "");
public void addPoliceman(Map<String, Object> policeman) {
Policeman police =new Policeman();
//将警员相关信息添加到警员表
//生成一个uuid
String uuid = UUID.randomUUID().toString().replaceAll("-", "");
//生成当前时间
Date currentDate = DateTimeUtil.getCurrentDateTime();
police.setId(uuid);
police.setCreateTime(currentDate);
police.setOrgId((String) policeman.get("orgId"));
police.setName((String) policeman.get("name"));
police.setUpdateUser((String) policeman.get("updateUser"));
police.setCabinetId((String) policeman.get("cabinetId"));
police.setSex((String) policeman.get("sex"));
police.setPhone((String) policeman.get("phone"));
police.setPoliceCode((String) policeman.get("policeCode"));
police.setFaceInfo((String) policeman.get("faceInfo"));
police.setPhoto((String) policeman.get("photo"));
policemanMapper.addPoliceman(police);
//一个警员可能有多个指纹信息,用list接收
List<Map<String, Object>> fingerMsgList = (List<Map<String, Object>>) policeman.get("fingerMsg");
//遍历指纹信息,将指纹信息添加到指纹表
for (Map<String, Object> fingerMsg : fingerMsgList) {
PoliceFinger finger =new PoliceFinger();
finger.setPoliceId(uuid);
finger.setName(fingerMsg.get("name").toString());
finger.setFingerInfo(fingerMsg.get("fingerInfo").toString());
finger.setCreateTime(currentDate);
policeFingerMapper.addFingers(finger);
}
@Override
public List<Policeman> getAllPoliceman() {
List<Policeman> allPoliceman = policemanMapper.getAllPoliceman();
return allPoliceman;
}
@Override
public Map<String,Object> getOnePolice(String id) {
policemanMapper.getOnePolice(id);
return null;
return policemanMapper.getOnePolice(id);
}
@Override
public void deletePolice(Map<String, Object> msg) {
//遍历要删除的警员id
List<Object> policeList = (List<Object>) msg.get("policeList");
for (Object policeId:policeList){
policemanMapper.deletePolice(policeId.toString());
}
}
@Override
public Map<String, Object> getPoliceMsg(String userId) {
return policemanMapper.getPoliceMsg(userId);
public void updatePolice(Map<String, Object> policeman) {
Policeman police =new Policeman();
//修改警员相关信息
//生成当前时间
Date currentDate = DateTimeUtil.getCurrentDateTime();
//police.setId(uuid);
police.setId((String) policeman.get("id"));
police.setUpdateTime(currentDate);
police.setOrgId((String) policeman.get("orgId"));
police.setName((String) policeman.get("name"));
police.setUpdateUser((String) policeman.get("updateUser"));
police.setCabinetId((String) policeman.get("cabinetId"));
police.setSex((String) policeman.get("sex"));
police.setPhone((String) policeman.get("phone"));
police.setPoliceCode((String) policeman.get("policeCode"));
police.setFaceInfo((String) policeman.get("faceInfo"));
police.setPhoto((String) policeman.get("photo"));
policemanMapper.updatePolice(police);
List<Map<String, Object>> fingerMsgList = (List<Map<String, Object>>) policeman.get("fingerMsg");
//修改指纹相关信息
for (Map<String, Object> fingerMsg : fingerMsgList) {
PoliceFinger finger =new PoliceFinger();
finger.setName(fingerMsg.get("name").toString());
finger.setFingerInfo(fingerMsg.get("fingerInfo").toString());
finger.setUpdateTime(currentDate);
policeFingerMapper.updateFingers(finger);
}
}
@Override
public List<String> getAllPoliceId(Map<String, Object> orgId) {
List<String> msg = policemanMapper.getAllPoliceId(orgId.get("orgId").toString());
return msg;
}
@Override
public void deleteFinger(Map<String, Object> msg) {
//遍历要删除的警员id
List<Object> fingerList = (List<Object>) msg.get("fingerList");
for (Object finger:fingerList){
policemanMapper.deleteFinger(finger.toString());
}
}
}
package com.junmp.jyzb.utils;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateTimeUtil {
private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public static Date getCurrentDateTime() {
Date currentDate = new Date();
String dateString = DATE_FORMAT.format(currentDate);
try {
return DATE_FORMAT.parse(dateString);
} catch (ParseException e) {
e.printStackTrace();
return null;
}
}
}
\ No newline at end of file
package com.junmp.jyzb.constant;
package com.junmp.jyzb.utils;
import org.omg.CORBA.NO_PERMISSION;
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.PoliceFingerMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.PoliceFinger">
<!--@mbg.generated-->
<!--@Table base_police_finger-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="police_id" jdbcType="VARCHAR" property="policeId" />
<result column="finger_info" jdbcType="LONGVARCHAR" property="fingerInfo" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, police_id, finger_info, create_time, update_time
</sql>
<select id="getFingersByUserId" parameterType="String" resultType="java.util.Map">
SELECT f.name,f.finger_info
SELECT f.id as fingerId,f.name,f.finger_info
FROM base_police_finger f
WHERE f.police_id = #{userId}
</select>
<insert id="addFingers">
insert into base_police_finger
(police_id,name,finger_info,create_time) VALUES (#{policeId},#{name},#{fingerInfo},#{createTime})
</insert>
<update id="updateFingers">
update base_police_finger p
set name = #{name},finger_info=#{fingerInfo},update_time=#{updateTime}
where p.id =#{id}
</update>
</mapper>
\ No newline at end of file
......@@ -3,50 +3,49 @@
<mapper namespace="com.junmp.jyzb.mapper.PolicemanMapper">
<insert id="addPoliceman" parameterType="com.junmp.jyzb.domain.Policeman">
insert into base_policeman
(
id ,
name,
cabinet_id,
org_id,
police_code,
sex,
face_info,
photo,
phone,
create_time,
update_time,
update_user,
exist_type
)
(id,name,cabinet_id,org_id,police_code,sex,face_info,photo,phone,create_time,update_user,exist_type)
values
(
1001,
123,
123,
123,
123,
123,
123,
123,
123,
"2021-09-01T14:30:30",
"2021-09-01T14:30:30",
123,
0
)
(#{id},#{name},#{cabinetId},#{orgId},#{policeCode},#{sex},#{faceInfo},#{photo},#{phone},#{createTime},#{updateUser},0)
</insert>
<select id="getAllPoliceman" resultType="com.junmp.jyzb.domain.Policeman">
select * from base_policeman;
<!-- <select id="" resultType="com.junmp.jyzb.domain.Policeman">-->
<!-- select * from base_policeman p,base_police_finger f-->
<!-- where p.id=f.police_id and exist_type=0;-->
<!-- </select>-->
<select id="getOnePolice" resultType="Map">
select id,name,cabinet_id,org_id,police_code,sex,face_info,photo from base_policeman p
where p.id=#{id} and exist_type=0
</select>
<select id="getOnePolice" resultType="java.util.List">
select * from base_policeman p,base_police_finger f
where p.id=f.police_id and f.police_id = #{id}
<update id="deletePolice">
update base_policeman p
set exist_type = 1
where p.id =#{id}
</update>
<update id="updatePolice">
update base_policeman p
set name = #{name},cabinet_id=#{cabinetId},org_id=#{orgId},police_code=#{policeCode},sex=#{sex},face_info=#{faceInfo},photo=#{photo},update_time=#{updateTime}
where p.id =#{id}
</update>
<select id="getAllPoliceman" resultType="Map">
select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info
from base_policeman p,base_police_finger f
where p.id=f.police_id
and p.org_id=#{orgId}
and exist_type=0
</select>
<select id="getPoliceMsg" resultType="Map">
select * from base_policeman p
where p.id=#{userId}
<select id="getAllPoliceId" resultType="String">
select id
from base_policeman p
where org_id=#{orgId} and exist_type=0;
</select>
<delete id="deleteFinger">
delete from base_police_finger
where id =#{fingerId}
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.junmp.jyzb.mapper.PoliceFingerMapper">
<resultMap id="BaseResultMap" type="com.junmp.jyzb.domain.PoliceFinger">
<!--@mbg.generated-->
<!--@Table base_police_finger-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="police_id" jdbcType="VARCHAR" property="policeId" />
<result column="finger_info" jdbcType="LONGVARCHAR" property="fingerInfo" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, police_id, finger_info, create_time, update_time
</sql>
<select id="getFingersByUserId" parameterType="String" resultType="java.util.Map">
SELECT f.name,f.finger_info
SELECT f.id as fingerId,f.name,f.finger_info
FROM base_police_finger f
WHERE f.police_id = #{userId}
</select>
<insert id="addFingers">
insert into base_police_finger
(police_id,name,finger_info,create_time) VALUES (#{policeId},#{name},#{fingerInfo},#{createTime})
</insert>
<update id="updateFingers">
update base_police_finger p
set name = #{name},finger_info=#{fingerInfo},update_time=#{updateTime}
where p.id =#{id}
</update>
</mapper>
\ No newline at end of file
......@@ -3,50 +3,49 @@
<mapper namespace="com.junmp.jyzb.mapper.PolicemanMapper">
<insert id="addPoliceman" parameterType="com.junmp.jyzb.domain.Policeman">
insert into base_policeman
(
id ,
name,
cabinet_id,
org_id,
police_code,
sex,
face_info,
photo,
phone,
create_time,
update_time,
update_user,
exist_type
)
(id,name,cabinet_id,org_id,police_code,sex,face_info,photo,phone,create_time,update_user,exist_type)
values
(
1001,
123,
123,
123,
123,
123,
123,
123,
123,
"2021-09-01T14:30:30",
"2021-09-01T14:30:30",
123,
0
)
(#{id},#{name},#{cabinetId},#{orgId},#{policeCode},#{sex},#{faceInfo},#{photo},#{phone},#{createTime},#{updateUser},0)
</insert>
<select id="getAllPoliceman" resultType="com.junmp.jyzb.domain.Policeman">
select * from base_policeman;
<!-- <select id="" resultType="com.junmp.jyzb.domain.Policeman">-->
<!-- select * from base_policeman p,base_police_finger f-->
<!-- where p.id=f.police_id and exist_type=0;-->
<!-- </select>-->
<select id="getOnePolice" resultType="Map">
select id,name,cabinet_id,org_id,police_code,sex,face_info,photo from base_policeman p
where p.id=#{id} and exist_type=0
</select>
<select id="getOnePolice" resultType="java.util.List">
select * from base_policeman p,base_police_finger f
where p.id=f.police_id and f.police_id = #{id}
<update id="deletePolice">
update base_policeman p
set exist_type = 1
where p.id =#{id}
</update>
<update id="updatePolice">
update base_policeman p
set name = #{name},cabinet_id=#{cabinetId},org_id=#{orgId},police_code=#{policeCode},sex=#{sex},face_info=#{faceInfo},photo=#{photo},update_time=#{updateTime}
where p.id =#{id}
</update>
<select id="getAllPoliceman" resultType="Map">
select p.id,p.name as police_name,cabinet_id,org_id,police_code,sex,face_info,photo ,f.name as finger_name,finger_info
from base_policeman p,base_police_finger f
where p.id=f.police_id
and p.org_id=#{orgId}
and exist_type=0
</select>
<select id="getPoliceMsg" resultType="Map">
select * from base_policeman p
where p.id=#{userId}
<select id="getAllPoliceId" resultType="String">
select id
from base_policeman p
where org_id=#{orgId} and exist_type=0;
</select>
<delete id="deleteFinger">
delete from base_police_finger
where id =#{fingerId}
</delete>
</mapper>
\ No newline at end of file
......@@ -59,7 +59,7 @@ mybatis-plus:
cache-enabled: true
lazy-loading-enabled: true
multiple-result-sets-enabled: true
map-underscore-to-camel-case: false
map-underscore-to-camel-case: true #开启驼峰命名
global-config:
banner: false
enable-sql-runner: true
......
......@@ -20,6 +20,7 @@ spring:
locale: zh_CN
serialization:
indent_output: false
property-naming-strategy: com.fasterxml.jackson.databind.PropertyNamingStrategy$PascalCaseStrategy
flyway:
enable: ture
locations: classpath:db/migration
......@@ -36,7 +37,7 @@ mybatis-plus:
cache-enabled: true
lazy-loading-enabled: true
multiple-result-sets-enabled: true
map-underscore-to-camel-case: false
map-underscore-to-camel-case: true #开启驼峰命名
global-config:
banner: false
enable-sql-runner: true
......
......@@ -59,7 +59,7 @@ mybatis-plus:
cache-enabled: true
lazy-loading-enabled: true
multiple-result-sets-enabled: true
map-underscore-to-camel-case: false
map-underscore-to-camel-case: true #开启驼峰命名
global-config:
banner: false
enable-sql-runner: true
......
......@@ -20,6 +20,7 @@ spring:
locale: zh_CN
serialization:
indent_output: false
property-naming-strategy: com.fasterxml.jackson.databind.PropertyNamingStrategy$PascalCaseStrategy
flyway:
enable: ture
locations: classpath:db/migration
......@@ -36,7 +37,7 @@ mybatis-plus:
cache-enabled: true
lazy-loading-enabled: true
multiple-result-sets-enabled: true
map-underscore-to-camel-case: false
map-underscore-to-camel-case: true #开启驼峰命名
global-config:
banner: false
enable-sql-runner: true
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>junmp-jyzb-app</artifactId>
<groupId>com.junmp.jyzb</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jyzb-business</artifactId>
<dependencies>
<!-- SpringBoot 测试 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.junmp.jyzb.utils;
import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResponseResult<T> {
/**
* 状态码
*/
private Integer code;
/**
* 提示信息,如果有错误时,前端可以获取该字段进行提示
*/
private String msg;
/**
* 查询到的结果数据,
*/
private T data;
public ResponseResult(Integer code, String msg) {
this.code = code;
this.msg = msg;
}
public ResponseResult(Integer code, T data) {
this.code = code;
this.data = data;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public ResponseResult(Integer code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论