学习身份信息认证接口接入及全局异常处理
parent
9e465b1ebc
commit
b99c566e31
@ -0,0 +1,25 @@
|
||||
package com.example.venue_reservation_service.controller;
|
||||
|
||||
import com.example.venue_reservation_service.service.PaymentService;
|
||||
import com.example.venue_reservation_service.vo.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/payment")
|
||||
@Api("支付流水模块")
|
||||
@CrossOrigin
|
||||
public class PaymentController {
|
||||
|
||||
@Resource
|
||||
private PaymentService paymentService;
|
||||
|
||||
// @ApiOperation("查询订单列表")
|
||||
// @PostMapping("/query")
|
||||
// public Result
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.example.venue_reservation_service.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName venue_institution
|
||||
*/
|
||||
@TableName(value ="venue_institution")
|
||||
@Data
|
||||
public class Institution implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
@Serial
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.venue_reservation_service.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 回复记录表
|
||||
* @TableName venue_reply
|
||||
*/
|
||||
@TableName(value ="venue_reply")
|
||||
@Data
|
||||
public class Reply implements Serializable {
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 管理员编号
|
||||
*/
|
||||
private Integer adminId;
|
||||
|
||||
/**
|
||||
* 回复内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createdTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updatedTime;
|
||||
|
||||
/**
|
||||
* 答疑记录编号
|
||||
*/
|
||||
private Integer questionId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.example.venue_reservation_service.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
// 人员信息类
|
||||
@Data
|
||||
public class PersonInfo {
|
||||
@JsonProperty("GH")
|
||||
private String employeeId;
|
||||
|
||||
@JsonProperty("XM")
|
||||
private String name;
|
||||
|
||||
@JsonProperty("SJHM")
|
||||
private String phone;
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.venue_reservation_service.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// 根响应类
|
||||
@Data
|
||||
public class ResponseData {
|
||||
|
||||
private String success;
|
||||
|
||||
private List<PersonInfo> message;
|
||||
|
||||
private PageInfo page;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
package com.example.venue_reservation_service.exception;
|
||||
|
||||
|
||||
/**
|
||||
* 身份认证业务异常
|
||||
*/
|
||||
public class IdentityException extends RuntimeException {
|
||||
private final String errorCode;
|
||||
|
||||
public IdentityException(String message) {
|
||||
super(message);
|
||||
this.errorCode = "IDENTITY_001"; // 默认为通用身份认证错误码
|
||||
}
|
||||
|
||||
public IdentityException(String errorCode, String message) {
|
||||
super(message);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.example.venue_reservation_service.exception;
|
||||
/**
|
||||
* 敏感词过滤异常
|
||||
*/
|
||||
public class SensitiveFilterException extends RuntimeException {
|
||||
|
||||
private String errorCode;
|
||||
|
||||
public SensitiveFilterException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public SensitiveFilterException(String errorCode, String message) {
|
||||
super(message);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.example.venue_reservation_service.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 敏感词操作异常
|
||||
*/
|
||||
@Getter
|
||||
public class SensitiveWordException extends RuntimeException {
|
||||
|
||||
private final String errorCode;
|
||||
|
||||
public SensitiveWordException(String errorCode, String message) {
|
||||
super(message);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
|
||||
public SensitiveWordException(String errorCode, String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.example.venue_reservation_service.mapper;
|
||||
|
||||
import com.example.venue_reservation_service.domain.Question;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_question(用户答疑记录表)】的数据库操作Mapper
|
||||
* @createDate 2025-06-21 14:15:36
|
||||
* @Entity generator.domain.Question
|
||||
*/
|
||||
public interface QuestionMapper extends BaseMapper<Question> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.example.venue_reservation_service.mapper;
|
||||
|
||||
import com.example.venue_reservation_service.domain.Reply;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_reply(回复记录表)】的数据库操作Mapper
|
||||
* @createDate 2025-06-21 14:15:36
|
||||
* @Entity generator.domain.Reply
|
||||
*/
|
||||
public interface ReplyMapper extends BaseMapper<Reply> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.example.venue_reservation_service.service;
|
||||
|
||||
import com.example.venue_reservation_service.domain.Institution;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_institution】的数据库操作Service
|
||||
* @createDate 2025-06-19 14:40:51
|
||||
*/
|
||||
public interface InstitutionService extends IService<Institution> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.example.venue_reservation_service.service;
|
||||
|
||||
import com.example.venue_reservation_service.domain.Question;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_question(用户答疑记录表)】的数据库操作Service
|
||||
* @createDate 2025-06-21 14:15:36
|
||||
*/
|
||||
public interface QuestionService extends IService<Question> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.example.venue_reservation_service.service;
|
||||
|
||||
import com.example.venue_reservation_service.domain.Reply;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_reply(回复记录表)】的数据库操作Service
|
||||
* @createDate 2025-06-21 14:15:36
|
||||
*/
|
||||
public interface ReplyService extends IService<Reply> {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.example.venue_reservation_service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.example.venue_reservation_service.domain.Institution;
|
||||
import com.example.venue_reservation_service.mapper.InstitutionMapper;
|
||||
import com.example.venue_reservation_service.service.InstitutionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_institution】的数据库操作Service实现
|
||||
* @createDate 2025-06-19 14:40:51
|
||||
*/
|
||||
@Service
|
||||
public class InstitutionServiceImpl extends ServiceImpl<InstitutionMapper, Institution>
|
||||
implements InstitutionService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.example.venue_reservation_service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.example.venue_reservation_service.domain.Question;
|
||||
import com.example.venue_reservation_service.mapper.QuestionMapper;
|
||||
import com.example.venue_reservation_service.service.QuestionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_question(用户答疑记录表)】的数据库操作Service实现
|
||||
* @createDate 2025-06-21 14:15:36
|
||||
*/
|
||||
@Service
|
||||
public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question>
|
||||
implements QuestionService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.example.venue_reservation_service.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.example.venue_reservation_service.domain.Reply;
|
||||
import com.example.venue_reservation_service.service.ReplyService;
|
||||
import com.example.venue_reservation_service.mapper.ReplyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author 31586
|
||||
* @description 针对表【venue_reply(回复记录表)】的数据库操作Service实现
|
||||
* @createDate 2025-06-21 14:15:36
|
||||
*/
|
||||
@Service
|
||||
public class ReplyServiceImpl extends ServiceImpl<ReplyMapper, Reply>
|
||||
implements ReplyService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
package com.example.venue_reservation_service.vo.hdjd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ResponseResult {
|
||||
@JsonProperty("success")
|
||||
private String success;
|
||||
|
||||
@JsonProperty("message")
|
||||
private List<Unit> message;
|
||||
|
||||
@JsonProperty("page")
|
||||
private Page page;
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
package com.example.venue_reservation_service.vo.hdjd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Unit {
|
||||
@JsonProperty("UNIT_ID")
|
||||
private String unitId;
|
||||
|
||||
@JsonProperty("DEPART_ORDER_ID")
|
||||
private String departOrderId;
|
||||
|
||||
@JsonProperty("UNIT_NAME")
|
||||
private String unitName;
|
||||
|
||||
@JsonProperty("PARENT_ID")
|
||||
private String parentId;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?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.example.venue_reservation_service.mapper.InstitutionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.example.venue_reservation_service.domain.Institution">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id ,name,type
|
||||
</sql>
|
||||
|
||||
<select id="selectByType" parameterType="string" resultType="string">
|
||||
SELECT name FROM venue_institution
|
||||
<where>
|
||||
<if test="type != null and type != ''">
|
||||
AND type = #{type}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?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.example.venue_reservation_service.mapper.QuestionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.example.venue_reservation_service.domain.Question">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="username" column="username" jdbcType="VARCHAR"/>
|
||||
<result property="phone" column="phone" jdbcType="VARCHAR"/>
|
||||
<result property="questionType" column="question_type" jdbcType="OTHER"/>
|
||||
<result property="description" column="description" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="status" column="status" jdbcType="OTHER"/>
|
||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,username,
|
||||
phone,question_type,description,
|
||||
created_time,status,type
|
||||
</sql>
|
||||
</mapper>
|
@ -0,0 +1,20 @@
|
||||
<?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.example.venue_reservation_service.mapper.ReplyMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.example.venue_reservation_service.domain.Reply">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="adminId" column="admin_id" jdbcType="INTEGER"/>
|
||||
<result property="content" column="content" jdbcType="VARCHAR"/>
|
||||
<result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="questionId" column="question_id" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,admin_id,content,
|
||||
created_time,updated_time,question_id
|
||||
</sql>
|
||||
</mapper>
|
Loading…
Reference in New Issue