最新版宁夏武警公众号项目后端
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.guahao.api.guided.controller;
|
||||
|
||||
import com.guahao.WebLog;
|
||||
import com.guahao.api.guided.model.Guided;
|
||||
import com.guahao.api.guided.model.QuestionType;
|
||||
import com.guahao.api.guided.service.GuidedService;
|
||||
import com.guahao.common.response.ResponseResult;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
*
|
||||
* @author: Mr.zs
|
||||
* @date: 2023/5/17
|
||||
* @description:
|
||||
* @modifiedBy:
|
||||
* @version: 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/guided")
|
||||
// @Slf4j
|
||||
public class GuidedController {
|
||||
|
||||
@Autowired
|
||||
private GuidedService guidedService;
|
||||
|
||||
@RequestMapping(value = "/getQuestionsType")
|
||||
@WebLog(description = "getQuestionsType")
|
||||
public Object getQuestionsType(String place) {
|
||||
// log.info("getQuestionsType is :" + place);
|
||||
List<QuestionType> questionTypes = guidedService.queryQuestionsType(place);
|
||||
|
||||
return ResponseResult.success(questionTypes);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/getQuestions")
|
||||
@WebLog(description = "getQuestions")
|
||||
public Object getQuestions(String area, String type) {
|
||||
|
||||
List<Guided> guideds = guidedService.queryGuidedByArea(area, type);
|
||||
return ResponseResult.success(guideds);
|
||||
}
|
||||
|
||||
}
|
||||
25
src/main/java/com/guahao/api/guided/mapper/GuidedMapper.java
Normal file
25
src/main/java/com/guahao/api/guided/mapper/GuidedMapper.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.guahao.api.guided.mapper;
|
||||
|
||||
import com.guahao.api.guided.model.Guided;
|
||||
import com.guahao.api.guided.model.QuestionType;
|
||||
import com.guahao.common.base.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
*
|
||||
* @author: Mr.zs
|
||||
* @date: 2023/5/17
|
||||
* @description:
|
||||
* @modifiedBy:
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface GuidedMapper extends BaseMapper<Guided> {
|
||||
|
||||
List<Guided> queryGuidedByArea(String area, String type);
|
||||
|
||||
List<QuestionType> queryQuestionsType(String place);
|
||||
}
|
||||
30
src/main/java/com/guahao/api/guided/model/Guided.java
Normal file
30
src/main/java/com/guahao/api/guided/model/Guided.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.guahao.api.guided.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
*
|
||||
* @author: Mr.zs
|
||||
* @date: 2023/5/17
|
||||
* @description:
|
||||
* @modifiedBy:
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Guided {
|
||||
|
||||
|
||||
private String id;
|
||||
private String question;
|
||||
private String departmentName;
|
||||
private String departmentNo;
|
||||
private String bodyAreaType;
|
||||
private String bodyArerName;
|
||||
private String questionType;
|
||||
private String questionTypeName;
|
||||
}
|
||||
25
src/main/java/com/guahao/api/guided/model/QuestionType.java
Normal file
25
src/main/java/com/guahao/api/guided/model/QuestionType.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.guahao.api.guided.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
*
|
||||
* @author: Mr.zs
|
||||
* @date: 2023/5/19
|
||||
* @description:
|
||||
* @modifiedBy:
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QuestionType {
|
||||
|
||||
private String bodyAreaType; // 原 body_area_type
|
||||
private String bodyAreaName; // 原 body_area_name
|
||||
private String questionType; // 原 question_type
|
||||
private String questionTypeName; // 原 question_type_name
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.guahao.api.guided.service;
|
||||
|
||||
import com.guahao.api.guided.mapper.GuidedMapper;
|
||||
import com.guahao.api.guided.model.Guided;
|
||||
import com.guahao.api.guided.model.QuestionType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created with IntelliJ IDEA.
|
||||
*
|
||||
* @author: Mr.zs
|
||||
* @date: 2023/5/17
|
||||
* @description:
|
||||
* @modifiedBy:
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Service
|
||||
public class GuidedService {
|
||||
|
||||
@Autowired
|
||||
GuidedMapper guidedMapper;
|
||||
|
||||
public List<Guided> queryGuidedByArea(String area, String type) {
|
||||
|
||||
return guidedMapper.queryGuidedByArea(area, type);
|
||||
}
|
||||
|
||||
public List<QuestionType> queryQuestionsType(String place) {
|
||||
|
||||
|
||||
return guidedMapper.queryQuestionsType(place);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user