diff --git a/src/main/java/com/sincere/student/controller/AdminController.java b/src/main/java/com/sincere/student/controller/AdminController.java index 4dc5d14..32b4afe 100644 --- a/src/main/java/com/sincere/student/controller/AdminController.java +++ b/src/main/java/com/sincere/student/controller/AdminController.java @@ -461,9 +461,11 @@ public class AdminController { temp.setSort(1); temp.setType(AdvertEnums.screen.getType()); temp.setImgUrl(dto.getUrl()); + temp.setUrlLink(dto.getUrlLink()); advertService.create(temp); }else { advert.setImgUrl(dto.getUrl()); + advert.setUrlLink(dto.getUrlLink()); advertService.update(advert); } return new BaseDto() ; diff --git a/src/main/java/com/sincere/student/controller/AppController.java b/src/main/java/com/sincere/student/controller/AppController.java index 5e55650..40c4214 100644 --- a/src/main/java/com/sincere/student/controller/AppController.java +++ b/src/main/java/com/sincere/student/controller/AppController.java @@ -106,6 +106,37 @@ public class AppController { return result ; } + @ApiOperation("首页 搜索 按钮 咨询列表") + @RequestMapping(value = "/consult/getConsultListSearch" , method = RequestMethod.POST) + public BaseDto> getConsultListSearch(@RequestBody ConsultSearchDto consultSearchDto){ + consultSearchDto.setStatus(1); + consultSearchDto.setPage(1); + consultSearchDto.setPageSize(3); + BaseDto> result = new BaseDto<>(); + List data = new ArrayList<>(); + ColumnDto columnDto = new ColumnDto(); + columnDto.setType(ColumnEnums.university.getType()); + List columnTypes = columnService.getList(columnDto); + if(columnTypes != null && columnTypes.size() > 0){ + for(ColumnType columnType : columnTypes){ + consultSearchDto.setColumnType(columnType.getId()); + Page page = consultService.getList(consultSearchDto); + AppConsult appConsult = new AppConsult(); + appConsult.setColumnTypeId(columnType.getId()); + appConsult.setName(columnType.getName()); + appConsult.setList(page.getList()); + if(appConsult.getList() != null && appConsult.getList().size() > 0){ + data.add(appConsult); + } + } + result.setData(data); + }else { + result.setSuccess(false); + result.setMessage("后台暂未分配招生咨询会栏目"); + } + return result ; + } + @ApiOperation("获取首页学校 咨询列表 more") @RequestMapping(value = "/consult/getConsultPage" , method = RequestMethod.POST) public BaseDto> getConsultTypeList(@RequestBody ConsultPageDto consultPageDto){ @@ -172,7 +203,24 @@ public class AppController { @RequestMapping(value = "/article/getDetail/{id}" , method = RequestMethod.POST) public BaseDto
getDetail(@PathVariable("id") int id){ BaseDto
result = new BaseDto<>() ; - result.setData(articleService.selectById(id)); + Article article = articleService.selectById(id) ; + result.setData(article); + Article temp = new Article(); + temp.setId(id); + temp.setLookNumber(article.getLookNumber()+1); + articleService.update(temp); + return result ; + } + + @ApiOperation(" 点赞 权威解读(文章广告)相关接口") + @RequestMapping(value = "/article/good/{id}" , method = RequestMethod.POST) + public BaseDto good(@PathVariable("id") int id){ + BaseDto result = new BaseDto<>() ; + Article article = articleService.selectById(id) ; + Article temp = new Article(); + temp.setId(id); + temp.setGoodNumber(article.getGoodNumber()+1); + articleService.update(temp); return result ; } diff --git a/src/main/java/com/sincere/student/controller/CommonController.java b/src/main/java/com/sincere/student/controller/CommonController.java index b4be695..566af54 100644 --- a/src/main/java/com/sincere/student/controller/CommonController.java +++ b/src/main/java/com/sincere/student/controller/CommonController.java @@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -18,11 +19,32 @@ public class CommonController { @Autowired CommonService commonService ; + private static List list = new ArrayList<>(); @ApiOperation("省份") @RequestMapping(value = "getProvince",method = RequestMethod.GET) public List getProvince(){ - return commonService.getProvince(); + if(list.size() == 0){ + List areas = commonService.getProvince(); + for(Area area : areas){ + List cityList = commonService.getCity(area.getCode()); + if(area.getName().contains("市")){ + //获取全部 + area.setList(cityList); + }else { + //获取4位的市 + List trueCityList = new ArrayList<>(); + for(Area city : cityList){ + if(city.getCode().length() < 6){ + trueCityList.add(city); + } + } + area.setList(trueCityList); + } + } + list = areas ; + } + return list ; } @ApiOperation("市") diff --git a/src/main/java/com/sincere/student/controller/IndexController.java b/src/main/java/com/sincere/student/controller/IndexController.java deleted file mode 100644 index 31407fe..0000000 --- a/src/main/java/com/sincere/student/controller/IndexController.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sincere.student.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; - -@Controller -public class IndexController { - - @RequestMapping("index") - public String index(){ - return "index" ; - } - - @ResponseBody - @RequestMapping(value = "upload" ,method = RequestMethod.POST) - public String upload(@RequestParam("file") MultipartFile file) throws Exception{ - return file.getOriginalFilename() ; - } -} diff --git a/src/main/java/com/sincere/student/dto/LinkUsDto.java b/src/main/java/com/sincere/student/dto/LinkUsDto.java index d13b9a7..48cf492 100644 --- a/src/main/java/com/sincere/student/dto/LinkUsDto.java +++ b/src/main/java/com/sincere/student/dto/LinkUsDto.java @@ -3,6 +3,15 @@ package com.sincere.student.dto; public class LinkUsDto { private String url ; + private String urlLink ; + + public String getUrlLink() { + return urlLink; + } + + public void setUrlLink(String urlLink) { + this.urlLink = urlLink; + } public String getUrl() { return url; diff --git a/src/main/java/com/sincere/student/model/Advert.java b/src/main/java/com/sincere/student/model/Advert.java index b81c53e..0e6615e 100644 --- a/src/main/java/com/sincere/student/model/Advert.java +++ b/src/main/java/com/sincere/student/model/Advert.java @@ -12,11 +12,11 @@ public class Advert { private int id ; @ApiModelProperty(value = "广告类型 1:开屏 2:banner 所有接口不用传") private int type ; - @ApiModelProperty(value = "图片地址") + @ApiModelProperty(value = "必传 图片地址") private String imgUrl ; @ApiModelProperty(value = "外链") private String urlLink ; - @ApiModelProperty(value = "排序") + @ApiModelProperty(value = "必传 排序") private int sort ; @ApiModelProperty(value = "状态 预留字段 所有接口不用传") private int status ; diff --git a/src/main/java/com/sincere/student/model/Area.java b/src/main/java/com/sincere/student/model/Area.java index 16e8f14..4637987 100644 --- a/src/main/java/com/sincere/student/model/Area.java +++ b/src/main/java/com/sincere/student/model/Area.java @@ -1,10 +1,22 @@ package com.sincere.student.model; +import java.util.List; + public class Area { private String code ; private String name ; + private List list ; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + public String getCode() { return code; } diff --git a/src/main/java/com/sincere/student/model/Article.java b/src/main/java/com/sincere/student/model/Article.java index feaaf51..4409778 100644 --- a/src/main/java/com/sincere/student/model/Article.java +++ b/src/main/java/com/sincere/student/model/Article.java @@ -10,17 +10,17 @@ public class Article { @ApiModelProperty(value = "主键 , 新增接口不用传") private int id ; - @ApiModelProperty(value = "标题") + @ApiModelProperty(value = "必传 标题") private String title ; @ApiModelProperty(value = "栏目 type=1 不用传") private int columnType ; - @ApiModelProperty(value = "大学id") + @ApiModelProperty(value = "必传 大学id") private int universityId ; - @ApiModelProperty(value = "排序") + @ApiModelProperty(value = "必传 排序") private int sort ; @ApiModelProperty(value = "内容") private String context ; - @ApiModelProperty(value = "作者") + @ApiModelProperty(value = "必传 作者") private String author ; @ApiModelProperty(value = "封面图片") private String imageUrl ; diff --git a/src/main/java/com/sincere/student/model/Major.java b/src/main/java/com/sincere/student/model/Major.java index 3ef97ec..3909b03 100644 --- a/src/main/java/com/sincere/student/model/Major.java +++ b/src/main/java/com/sincere/student/model/Major.java @@ -8,9 +8,9 @@ public class Major { @ApiModelProperty(value = "主键 , 新增接口不用传") private int id ; - @ApiModelProperty(value = "专业名") + @ApiModelProperty(value = "必传 专业名") private String major ; - @ApiModelProperty(value = "专业编码") + @ApiModelProperty(value = "必传 专业编码") private String majorCode ; @ApiModelProperty(value = "父级专业id") //-1 说明是一级专业 private int pId ; diff --git a/src/main/java/com/sincere/student/model/Message.java b/src/main/java/com/sincere/student/model/Message.java index 8183e51..53feee3 100644 --- a/src/main/java/com/sincere/student/model/Message.java +++ b/src/main/java/com/sincere/student/model/Message.java @@ -10,9 +10,9 @@ import java.util.List; public class Message { @ApiModelProperty(value = "主键 , 新增接口不用传") private Integer id; - @ApiModelProperty(value = "标题") + @ApiModelProperty(value = "必传 标题") private String title; - @ApiModelProperty(value = "内容") + @ApiModelProperty(value = "必传 内容") private String context; @ApiModelProperty(value = "联系方式") private String phone; diff --git a/src/main/java/com/sincere/student/model/Reply.java b/src/main/java/com/sincere/student/model/Reply.java index f884cc3..6a33e7a 100644 --- a/src/main/java/com/sincere/student/model/Reply.java +++ b/src/main/java/com/sincere/student/model/Reply.java @@ -11,7 +11,7 @@ public class Reply { private Integer id; @ApiModelProperty(value = "留言主键") private Integer messageId; - @ApiModelProperty(value = "内容") + @ApiModelProperty(value = "必传 内容") private String context; @ApiModelProperty(value = "不用传") private Date createTime; diff --git a/src/main/java/com/sincere/student/model/SubmitFile.java b/src/main/java/com/sincere/student/model/SubmitFile.java index 69c2794..6b9f779 100644 --- a/src/main/java/com/sincere/student/model/SubmitFile.java +++ b/src/main/java/com/sincere/student/model/SubmitFile.java @@ -10,13 +10,13 @@ import java.util.List; public class SubmitFile { @ApiModelProperty(value = "主键 , 新增接口不用传") private Integer id; - @ApiModelProperty(value = "标题") + @ApiModelProperty(value = "必传 标题") private String title; - @ApiModelProperty(value = "年") + @ApiModelProperty(value = "必传 年") private String year; - @ApiModelProperty(value = "排序") + @ApiModelProperty(value = "必传 排序") private Integer sort; - @ApiModelProperty(value = "文件路径") + @ApiModelProperty(value = "必传 文件路径") private String fileUrl ; @ApiModelProperty(value = "不用传") private Date createTime; diff --git a/src/main/java/com/sincere/student/model/University.java b/src/main/java/com/sincere/student/model/University.java index 0588341..351e5cc 100644 --- a/src/main/java/com/sincere/student/model/University.java +++ b/src/main/java/com/sincere/student/model/University.java @@ -11,19 +11,19 @@ public class University { @ApiModelProperty(value = "主键 , 新增接口不用传") private int id ; - @ApiModelProperty(value = "学校名称") + @ApiModelProperty(value = "必传 学校名称") private String name ; - @ApiModelProperty(value = "学校编码") + @ApiModelProperty(value = "必传 学校编码") private String code ; - @ApiModelProperty(value = "高校学科类型") + @ApiModelProperty(value = "必传 高校学科类型") private String universityType ; - @ApiModelProperty(value = "主管部门") + @ApiModelProperty(value = "必传 主管部门") private String department; - @ApiModelProperty(value = "所在省") + @ApiModelProperty(value = "必传 所在省") private String province ; - @ApiModelProperty(value = "所在市") + @ApiModelProperty(value = "必传 所在市") private String city ; - @ApiModelProperty(value = "办学层次") + @ApiModelProperty(value = "必传 办学层次") private String level ; @ApiModelProperty(value = "联系方式") private String phone ; diff --git a/src/main/resources/mapper/ArticleMapper.xml b/src/main/resources/mapper/ArticleMapper.xml index b7b45dc..83b362f 100644 --- a/src/main/resources/mapper/ArticleMapper.xml +++ b/src/main/resources/mapper/ArticleMapper.xml @@ -24,7 +24,7 @@ select * from university_article - + and title like #{title} @@ -90,9 +90,6 @@ column_type=#{columnType}, - - university_name=#{universityName}, - university_id=#{universityId}, diff --git a/src/main/resources/mapper/MajorMapper.xml b/src/main/resources/mapper/MajorMapper.xml index a2f7c33..603278f 100644 --- a/src/main/resources/mapper/MajorMapper.xml +++ b/src/main/resources/mapper/MajorMapper.xml @@ -15,7 +15,7 @@ and p_id = #{pId} - + and major like #{major} @@ -27,7 +27,7 @@ and p_id = #{pId} - + and major like #{major} diff --git a/src/main/resources/mapper/UniversityConsultMapper.xml b/src/main/resources/mapper/UniversityConsultMapper.xml index dc897f7..ad11503 100644 --- a/src/main/resources/mapper/UniversityConsultMapper.xml +++ b/src/main/resources/mapper/UniversityConsultMapper.xml @@ -24,16 +24,16 @@ and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort) - + and info.province = #{province} - + and info.city = #{city} - + and info.name like #{universityName} - + and m.major like #{majorName} @@ -57,16 +57,16 @@ and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort) - + and info.province = #{province} - + and info.city = #{city} - + and info.name like #{universityName} - + and m.major like #{majorName} diff --git a/src/main/resources/mapper/UniversityMapper.xml b/src/main/resources/mapper/UniversityMapper.xml index 824096c..d284dc8 100644 --- a/src/main/resources/mapper/UniversityMapper.xml +++ b/src/main/resources/mapper/UniversityMapper.xml @@ -18,7 +18,7 @@ select * from university_info - + and name like #{search} diff --git a/src/main/resources/mapper/UniversityMessageMapper.xml b/src/main/resources/mapper/UniversityMessageMapper.xml index 7db58a0..516c231 100644 --- a/src/main/resources/mapper/UniversityMessageMapper.xml +++ b/src/main/resources/mapper/UniversityMessageMapper.xml @@ -12,7 +12,7 @@ select * from university_message - + and title like #{search} diff --git a/src/main/resources/mapper/UniversitySubmitFileMapper.xml b/src/main/resources/mapper/UniversitySubmitFileMapper.xml index 4b10536..41100cc 100644 --- a/src/main/resources/mapper/UniversitySubmitFileMapper.xml +++ b/src/main/resources/mapper/UniversitySubmitFileMapper.xml @@ -26,16 +26,16 @@ and sf.id = #{submitId} - + and info.name like #{universityName} - + and info.province = #{province} - + and info.city = #{city} - + and m.major like #{majorName} @@ -56,16 +56,16 @@ and sf.id = #{submitId} - + and info.name like #{universityName} - + and info.province = #{province} - + and info.city = #{city} - + and m.major like #{majorName} @@ -89,7 +89,7 @@ select * from university_submit_file - + title like #{search} diff --git a/src/main/resources/mapper/VideoMapper.xml b/src/main/resources/mapper/VideoMapper.xml index de6edd1..6c5724f 100644 --- a/src/main/resources/mapper/VideoMapper.xml +++ b/src/main/resources/mapper/VideoMapper.xml @@ -27,7 +27,7 @@ and 1 = 1 - + and info.name like #{universityName} @@ -45,7 +45,7 @@ and v.column_type = #{columnTypeId} - + and info.name like #{universityName} -- libgit2 0.21.0