Commit b246a387b84e8f04941da634e08efad03e1ae87c
1 parent
3c7f8a2c
Exists in
master
bug 修复
Showing
20 changed files
with
369 additions
and
81 deletions
 
Show diff stats
pom.xml
| ... | ... | @@ -12,6 +12,27 @@ | 
| 12 | 12 | <artifactId>enrollStudent</artifactId> | 
| 13 | 13 | |
| 14 | 14 | <dependencies> | 
| 15 | +<!-- <dependency>--> | |
| 16 | +<!-- <groupId>org.springframework.boot</groupId>--> | |
| 17 | +<!-- <artifactId>spring-boot-starter-data-redis</artifactId>--> | |
| 18 | +<!-- <version>2.2.1.RELEASE</version>--> | |
| 19 | +<!-- </dependency>--> | |
| 20 | +<!-- <dependency>--> | |
| 21 | +<!-- <groupId>org.apache.commons</groupId>--> | |
| 22 | +<!-- <artifactId>commons-pool2</artifactId>--> | |
| 23 | +<!-- <version>2.4.2</version>--> | |
| 24 | +<!-- </dependency>--> | |
| 25 | + <dependency> | |
| 26 | + <groupId>org.springframework.boot</groupId> | |
| 27 | + <artifactId>spring-boot-starter-web</artifactId> | |
| 28 | + </dependency> | |
| 29 | + <dependency> | |
| 30 | + <groupId>org.springframework.boot</groupId> | |
| 31 | + <artifactId>spring-boot-starter-test</artifactId> | |
| 32 | + <scope>test</scope> | |
| 33 | + </dependency> | |
| 34 | + | |
| 35 | + | |
| 15 | 36 | <dependency> | 
| 16 | 37 | <groupId>org.mybatis.generator</groupId> | 
| 17 | 38 | <artifactId>mybatis-generator-core</artifactId> | 
| ... | ... | @@ -47,11 +68,7 @@ | 
| 47 | 68 | <artifactId>nimbus-jose-jwt</artifactId> | 
| 48 | 69 | <version>6.0</version> | 
| 49 | 70 | </dependency> | 
| 50 | - <dependency> | |
| 51 | - <groupId>org.springframework.boot</groupId> | |
| 52 | - <artifactId>spring-boot-starter-test</artifactId> | |
| 53 | - <scope>test</scope> | |
| 54 | - </dependency> | |
| 71 | + | |
| 55 | 72 | <dependency> | 
| 56 | 73 | <groupId>org.apache.commons</groupId> | 
| 57 | 74 | <artifactId>commons-lang3</artifactId> | 
| ... | ... | @@ -67,10 +84,7 @@ | 
| 67 | 84 | <artifactId>mssql-jdbc</artifactId> | 
| 68 | 85 | <version>6.4.0.jre8</version> | 
| 69 | 86 | </dependency> | 
| 70 | - <dependency> | |
| 71 | - <groupId>org.springframework.boot</groupId> | |
| 72 | - <artifactId>spring-boot-starter-web</artifactId> | |
| 73 | - </dependency> | |
| 87 | + | |
| 74 | 88 | <dependency> | 
| 75 | 89 | <groupId>org.apache.commons</groupId> | 
| 76 | 90 | <artifactId>commons-lang3</artifactId> | ... | ... | 
src/main/java/com/sincere/student/controller/AdminController.java
| ... | ... | @@ -14,6 +14,8 @@ import com.sincere.student.utils.TokenUtils; | 
| 14 | 14 | import io.swagger.annotations.ApiOperation; | 
| 15 | 15 | import org.apache.commons.lang3.StringUtils; | 
| 16 | 16 | import org.springframework.beans.factory.annotation.Autowired; | 
| 17 | +import org.springframework.cache.annotation.CacheEvict; | |
| 18 | +import org.springframework.cache.annotation.Cacheable; | |
| 17 | 19 | import org.springframework.web.bind.annotation.*; | 
| 18 | 20 | |
| 19 | 21 | import java.util.ArrayList; | 
| ... | ... | @@ -544,6 +546,15 @@ public class AdminController { | 
| 544 | 546 | } | 
| 545 | 547 | |
| 546 | 548 | @MemberAccess | 
| 549 | + @ApiOperation("获取详情 栏目") | |
| 550 | + @RequestMapping(value = "/column/getDetail" , method = RequestMethod.POST) | |
| 551 | + public BaseDto createColumn(@RequestBody IdDto idDto){ | |
| 552 | + BaseDto result = new BaseDto() ; | |
| 553 | + ColumnType c = columnService.selectDetail(idDto.getId()); | |
| 554 | + return result ; | |
| 555 | + } | |
| 556 | + | |
| 557 | + @MemberAccess | |
| 547 | 558 | @ApiOperation("更新栏目(type : 1 文章 2学校 3视频)") | 
| 548 | 559 | @RequestMapping(value = "/column/update" , method = RequestMethod.POST) | 
| 549 | 560 | public BaseDto updateColumn(@RequestBody ColumnType columnType){ | 
| ... | ... | @@ -586,7 +597,7 @@ public class AdminController { | 
| 586 | 597 | } | 
| 587 | 598 | }else if(columnType.getType() == ColumnEnums.video.getType()){ | 
| 588 | 599 | VideoSearchDto videoSearchDto = new VideoSearchDto(); | 
| 589 | - videoSearchDto.setColumnTypeId(columnType.getId()); | |
| 600 | + videoSearchDto.setColumnType(columnType.getId()); | |
| 590 | 601 | videoSearchDto.setPage(1); | 
| 591 | 602 | videoSearchDto.setPageSize(10); | 
| 592 | 603 | Page<Video> videoPage = videoService.getList(videoSearchDto); | ... | ... | 
src/main/java/com/sincere/student/controller/AppController.java
| ... | ... | @@ -159,10 +159,10 @@ public class AppController { | 
| 159 | 159 | } | 
| 160 | 160 | |
| 161 | 161 | @ApiOperation("获取招生咨询会详情相关接口") | 
| 162 | - @RequestMapping(value = "/consult/getDetail/{id}" , method = RequestMethod.POST) | |
| 163 | - public BaseDto<Consult> getConsultDetail(@PathVariable("id") int id){ | |
| 162 | + @RequestMapping(value = "/consult/getDetail" , method = RequestMethod.POST) | |
| 163 | + public BaseDto<Consult> getConsultDetail(@RequestBody IdDto id){ | |
| 164 | 164 | BaseDto<Consult> result = new BaseDto<>() ; | 
| 165 | - result.setData(consultService.getDetail(id)); | |
| 165 | + result.setData(consultService.getDetail(id.getId())); | |
| 166 | 166 | return result ; | 
| 167 | 167 | } | 
| 168 | 168 | |
| ... | ... | @@ -170,9 +170,10 @@ public class AppController { | 
| 170 | 170 | * 栏目相关接口 | 
| 171 | 171 | */ | 
| 172 | 172 | @ApiOperation("获取栏目列表(1 文章 2学校 3视频)") | 
| 173 | - @RequestMapping(value = "/column/getList/{type}" , method = RequestMethod.POST) | |
| 174 | - public BaseDto<List<ColumnType>> getColumnList(@PathVariable("type") int type){ | |
| 173 | + @RequestMapping(value = "/column/getList" , method = RequestMethod.POST) | |
| 174 | + public BaseDto<List<ColumnType>> getColumnList(@RequestBody IdDto idDto){ | |
| 175 | 175 | BaseDto<List<ColumnType>> result = new BaseDto<>(); | 
| 176 | + int type = idDto.getId(); | |
| 176 | 177 | ColumnEnums columnEnums = ColumnEnums.getByType(type); | 
| 177 | 178 | if(columnEnums != null){ | 
| 178 | 179 | ColumnDto columnDto = new ColumnDto() ; | 
| ... | ... | @@ -199,36 +200,36 @@ public class AppController { | 
| 199 | 200 | return result ; | 
| 200 | 201 | } | 
| 201 | 202 | |
| 202 | - @ApiOperation("获取权威解读(文章广告)相关接口") | |
| 203 | - @RequestMapping(value = "/article/getDetail/{id}" , method = RequestMethod.POST) | |
| 204 | - public BaseDto<Article> getDetail(@PathVariable("id") int id){ | |
| 203 | + @ApiOperation("获取权威解读(文章广告)详情相关接口") | |
| 204 | + @RequestMapping(value = "/article/getDetail" , method = RequestMethod.POST) | |
| 205 | + public BaseDto<Article> getDetail(@RequestBody IdDto idDto){ | |
| 205 | 206 | BaseDto<Article> result = new BaseDto<>() ; | 
| 206 | - Article article = articleService.selectById(id) ; | |
| 207 | + Article article = articleService.selectById(idDto.getId()) ; | |
| 207 | 208 | result.setData(article); | 
| 208 | 209 | Article temp = new Article(); | 
| 209 | - temp.setId(id); | |
| 210 | + temp.setId(idDto.getId()); | |
| 210 | 211 | temp.setLookNumber(article.getLookNumber()+1); | 
| 211 | 212 | articleService.update(temp); | 
| 212 | 213 | return result ; | 
| 213 | 214 | } | 
| 214 | 215 | |
| 215 | 216 | @ApiOperation(" 点赞 权威解读(文章广告)相关接口") | 
| 216 | - @RequestMapping(value = "/article/good/{id}" , method = RequestMethod.POST) | |
| 217 | - public BaseDto good(@PathVariable("id") int id){ | |
| 217 | + @RequestMapping(value = "/article/good" , method = RequestMethod.POST) | |
| 218 | + public BaseDto good(@RequestBody IdDto idDto){ | |
| 218 | 219 | BaseDto result = new BaseDto<>() ; | 
| 219 | - Article article = articleService.selectById(id) ; | |
| 220 | + Article article = articleService.selectById(idDto.getId()) ; | |
| 220 | 221 | Article temp = new Article(); | 
| 221 | - temp.setId(id); | |
| 222 | + temp.setId(idDto.getId()); | |
| 222 | 223 | temp.setGoodNumber(article.getGoodNumber()+1); | 
| 223 | 224 | articleService.update(temp); | 
| 224 | 225 | return result ; | 
| 225 | 226 | } | 
| 226 | 227 | |
| 227 | - @ApiOperation("获取权威解读(文章广告) 相关咨询 相关接口") | |
| 228 | - @RequestMapping(value = "/article/getRelation/{universityId}" , method = RequestMethod.POST) | |
| 229 | - public BaseDto<List<Article>> getRelation(@PathVariable("universityId") int universityId){ | |
| 228 | + @ApiOperation("获取权威解读(文章广告) 相关咨询 相关接口 传学校id") | |
| 229 | + @RequestMapping(value = "/article/getRelation" , method = RequestMethod.POST) | |
| 230 | + public BaseDto<List<Article>> getRelation(@RequestBody IdDto idDto){ | |
| 230 | 231 | BaseDto<List<Article>> result = new BaseDto<>() ; | 
| 231 | - result.setData(articleService.getRelationList(universityId)); | |
| 232 | + result.setData(articleService.getRelationList(idDto.getId())); | |
| 232 | 233 | return result ; | 
| 233 | 234 | } | 
| 234 | 235 | |
| ... | ... | @@ -255,10 +256,10 @@ public class AppController { | 
| 255 | 256 | } | 
| 256 | 257 | |
| 257 | 258 | @ApiOperation("留言板详情,管理回复 接口") | 
| 258 | - @RequestMapping(value = "/message/getDetail/{id}" , method = RequestMethod.POST) | |
| 259 | - public BaseDto<Message> getMessageDetail(@PathVariable("id") int id){ | |
| 259 | + @RequestMapping(value = "/message/getDetail" , method = RequestMethod.POST) | |
| 260 | + public BaseDto<Message> getMessageDetail(@RequestBody IdDto idDto){ | |
| 260 | 261 | BaseDto<Message> result = new BaseDto<>(); | 
| 261 | - result.setData(messageService.getDetail(id)); | |
| 262 | + result.setData(messageService.getDetail(idDto.getId())); | |
| 262 | 263 | return result ; | 
| 263 | 264 | } | 
| 264 | 265 | |
| ... | ... | @@ -275,16 +276,18 @@ public class AppController { | 
| 275 | 276 | public BaseDto<Page<Video>> getVideoList(@RequestBody VideoSearchDto videoSearchDto){ | 
| 276 | 277 | BaseDto<Page<Video>> result = new BaseDto<>() ; | 
| 277 | 278 | videoSearchDto.setStatus(1); | 
| 278 | - Page<Video> page = videoService.getList(videoSearchDto); | |
| 279 | + Page<Video> page = videoService.getUniversityList(videoSearchDto); | |
| 279 | 280 | result.setData(page); | 
| 280 | 281 | return result ; | 
| 281 | 282 | } | 
| 282 | 283 | |
| 283 | 284 | @ApiOperation("获取视频相关接口") | 
| 284 | - @RequestMapping(value = "/video/getDetail/{id}" , method = RequestMethod.POST) | |
| 285 | - public BaseDto<Video> getVideoDetail(@PathVariable ("id") int id){ | |
| 286 | - BaseDto<Video> result = new BaseDto<>() ; | |
| 287 | - result.setData(videoService.getDetail(id)); | |
| 285 | + @RequestMapping(value = "/video/getDetail" , method = RequestMethod.POST) | |
| 286 | + public BaseDto<Page<Video>> getVideoDetail(@RequestBody VideoSearchDto videoSearchDto){ | |
| 287 | + BaseDto<Page<Video>> result = new BaseDto<>() ; | |
| 288 | + videoSearchDto.setStatus(1); | |
| 289 | + Page<Video> page = videoService.getList(videoSearchDto); | |
| 290 | + result.setData(page); | |
| 288 | 291 | return result ; | 
| 289 | 292 | } | 
| 290 | 293 | ... | ... | 
src/main/java/com/sincere/student/dto/VideoSearchDto.java
| ... | ... | @@ -7,13 +7,23 @@ import io.swagger.annotations.ApiModelProperty; | 
| 7 | 7 | public class VideoSearchDto extends PageDto { | 
| 8 | 8 | |
| 9 | 9 | @ApiModelProperty(value = "视频栏目主键") | 
| 10 | - private int columnTypeId ; | |
| 10 | + private int columnType ; | |
| 11 | 11 | |
| 12 | 12 | @ApiModelProperty(value = "查询名称") | 
| 13 | 13 | private String universityName ; | 
| 14 | + @ApiModelProperty(value = "学校主键") | |
| 15 | + private int universityId ; | |
| 14 | 16 | @ApiModelProperty(value = "状态 0预览1发布 都不用传") | 
| 15 | 17 | private int status ; | 
| 16 | 18 | |
| 19 | + public int getUniversityId() { | |
| 20 | + return universityId; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public void setUniversityId(int universityId) { | |
| 24 | + this.universityId = universityId; | |
| 25 | + } | |
| 26 | + | |
| 17 | 27 | public int getStatus() { | 
| 18 | 28 | return status; | 
| 19 | 29 | } | 
| ... | ... | @@ -21,12 +31,13 @@ public class VideoSearchDto extends PageDto { | 
| 21 | 31 | public void setStatus(int status) { | 
| 22 | 32 | this.status = status; | 
| 23 | 33 | } | 
| 24 | - public int getColumnTypeId() { | |
| 25 | - return columnTypeId; | |
| 34 | + | |
| 35 | + public int getColumnType() { | |
| 36 | + return columnType; | |
| 26 | 37 | } | 
| 27 | 38 | |
| 28 | - public void setColumnTypeId(int columnTypeId) { | |
| 29 | - this.columnTypeId = columnTypeId; | |
| 39 | + public void setColumnType(int columnType) { | |
| 40 | + this.columnType = columnType; | |
| 30 | 41 | } | 
| 31 | 42 | |
| 32 | 43 | public String getUniversityName() { | ... | ... | 
src/main/java/com/sincere/student/mapper/VideoMapper.java
| ... | ... | @@ -11,6 +11,10 @@ public interface VideoMapper { | 
| 11 | 11 | |
| 12 | 12 | List<Video> getList(VideoSearchDto dto); | 
| 13 | 13 | |
| 14 | + int getUniversityListCount(VideoSearchDto dto); | |
| 15 | + | |
| 16 | + List<Video> getUniversityList(VideoSearchDto dto); | |
| 17 | + | |
| 14 | 18 | int create(Video video); | 
| 15 | 19 | |
| 16 | 20 | int update(Video video); | ... | ... | 
src/main/java/com/sincere/student/model/Advert.java
| ... | ... | @@ -3,11 +3,13 @@ package com.sincere.student.model; | 
| 3 | 3 | import io.swagger.annotations.ApiModel; | 
| 4 | 4 | import io.swagger.annotations.ApiModelProperty; | 
| 5 | 5 | |
| 6 | +import java.io.Serializable; | |
| 6 | 7 | import java.util.Date; | 
| 7 | 8 | |
| 8 | 9 | @ApiModel | 
| 9 | -public class Advert { | |
| 10 | +public class Advert implements Serializable { | |
| 10 | 11 | |
| 12 | + private static final long serialVersionUID = 765348013299664647L; | |
| 11 | 13 | @ApiModelProperty(value = "主键 , 新增接口不用传") | 
| 12 | 14 | private int id ; | 
| 13 | 15 | @ApiModelProperty(value = "广告类型 1:开屏 2:banner 所有接口不用传") | 
| ... | ... | @@ -88,4 +90,18 @@ public class Advert { | 
| 88 | 90 | public void setTitle(String title) { | 
| 89 | 91 | this.title = title; | 
| 90 | 92 | } | 
| 93 | + | |
| 94 | + @Override | |
| 95 | + public String toString() { | |
| 96 | + return "Advert{" + | |
| 97 | + "id=" + id + | |
| 98 | + ", type=" + type + | |
| 99 | + ", imgUrl='" + imgUrl + '\'' + | |
| 100 | + ", urlLink='" + urlLink + '\'' + | |
| 101 | + ", sort=" + sort + | |
| 102 | + ", status=" + status + | |
| 103 | + ", createTime=" + createTime + | |
| 104 | + ", title='" + title + '\'' + | |
| 105 | + '}'; | |
| 106 | + } | |
| 91 | 107 | } | ... | ... | 
src/main/java/com/sincere/student/model/ColumnType.java
| ... | ... | @@ -3,10 +3,11 @@ package com.sincere.student.model; | 
| 3 | 3 | import io.swagger.annotations.ApiModel; | 
| 4 | 4 | import io.swagger.annotations.ApiModelProperty; | 
| 5 | 5 | |
| 6 | +import java.io.Serializable; | |
| 6 | 7 | import java.util.Date; | 
| 7 | 8 | |
| 8 | 9 | @ApiModel | 
| 9 | -public class ColumnType { | |
| 10 | +public class ColumnType implements Serializable { | |
| 10 | 11 | |
| 11 | 12 | @ApiModelProperty(value = "主键 , 新增接口不用传") | 
| 12 | 13 | private int id ; | ... | ... | 
src/main/java/com/sincere/student/model/Consult.java
| ... | ... | @@ -29,9 +29,19 @@ public class Consult { | 
| 29 | 29 | private String context; | 
| 30 | 30 | @ApiModelProperty(value = "联系方式") | 
| 31 | 31 | private String phone; | 
| 32 | + @ApiModelProperty(value = "状态") | |
| 33 | + private Integer status; | |
| 32 | 34 | @ApiModelProperty(value = "4个栏目") | 
| 33 | 35 | private List<UniversityConsultDetail> list ; | 
| 34 | 36 | |
| 37 | + public Integer getStatus() { | |
| 38 | + return status; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setStatus(Integer status) { | |
| 42 | + this.status = status; | |
| 43 | + } | |
| 44 | + | |
| 35 | 45 | public int getId() { | 
| 36 | 46 | return id; | 
| 37 | 47 | } | ... | ... | 
src/main/java/com/sincere/student/model/University.java
| ... | ... | @@ -27,11 +27,21 @@ public class University { | 
| 27 | 27 | private String level ; | 
| 28 | 28 | @ApiModelProperty(value = "联系方式") | 
| 29 | 29 | private String phone ; | 
| 30 | + @ApiModelProperty(value = "logo") | |
| 31 | + private String logoUrl ; | |
| 30 | 32 | @ApiModelProperty(value = "创建时间") | 
| 31 | 33 | private Date createTime ; | 
| 32 | 34 | @ApiModelProperty(value = "专业列表,展示用") | 
| 33 | 35 | private List<String> majorList ; | 
| 34 | 36 | |
| 37 | + public String getLogoUrl() { | |
| 38 | + return logoUrl; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public void setLogoUrl(String logoUrl) { | |
| 42 | + this.logoUrl = logoUrl; | |
| 43 | + } | |
| 44 | + | |
| 35 | 45 | public String getPhone() { | 
| 36 | 46 | return phone; | 
| 37 | 47 | } | ... | ... | 
src/main/java/com/sincere/student/model/Video.java
| ... | ... | @@ -21,11 +21,21 @@ public class Video { | 
| 21 | 21 | @ApiModelProperty(value = "创建时间") | 
| 22 | 22 | private Date createTime ; | 
| 23 | 23 | @ApiModelProperty(value = "学校名称 展示用") | 
| 24 | - private String universityName; | |
| 24 | + private String name; | |
| 25 | 25 | @ApiModelProperty(value = "学校编码 展示用") | 
| 26 | - private String universityCode; | |
| 26 | + private String code; | |
| 27 | 27 | @ApiModelProperty(value = "状态 0预览1发布") | 
| 28 | 28 | private int status ; | 
| 29 | + @ApiModelProperty(value = "图片地址") | |
| 30 | + private int imgUrl ; | |
| 31 | + | |
| 32 | + public int getImgUrl() { | |
| 33 | + return imgUrl; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public void setImgUrl(int imgUrl) { | |
| 37 | + this.imgUrl = imgUrl; | |
| 38 | + } | |
| 29 | 39 | |
| 30 | 40 | public int getStatus() { | 
| 31 | 41 | return status; | 
| ... | ... | @@ -35,20 +45,20 @@ public class Video { | 
| 35 | 45 | this.status = status; | 
| 36 | 46 | } | 
| 37 | 47 | |
| 38 | - public String getUniversityCode() { | |
| 39 | - return universityCode; | |
| 48 | + public String getName() { | |
| 49 | + return name; | |
| 40 | 50 | } | 
| 41 | 51 | |
| 42 | - public void setUniversityCode(String universityCode) { | |
| 43 | - this.universityCode = universityCode; | |
| 52 | + public void setName(String name) { | |
| 53 | + this.name = name; | |
| 44 | 54 | } | 
| 45 | 55 | |
| 46 | - public String getUniversityName() { | |
| 47 | - return universityName; | |
| 56 | + public String getCode() { | |
| 57 | + return code; | |
| 48 | 58 | } | 
| 49 | 59 | |
| 50 | - public void setUniversityName(String universityName) { | |
| 51 | - this.universityName = universityName; | |
| 60 | + public void setCode(String code) { | |
| 61 | + this.code = code; | |
| 52 | 62 | } | 
| 53 | 63 | |
| 54 | 64 | public int getId() { | ... | ... | 
src/main/java/com/sincere/student/service/AdvertService.java
src/main/java/com/sincere/student/service/VideoService.java
| ... | ... | @@ -4,8 +4,12 @@ import com.sincere.student.dto.VideoSearchDto; | 
| 4 | 4 | import com.sincere.student.model.Video; | 
| 5 | 5 | import com.sincere.student.utils.Page; | 
| 6 | 6 | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 7 | 9 | public interface VideoService { | 
| 8 | 10 | |
| 11 | + Page<Video> getUniversityList(VideoSearchDto dto); | |
| 12 | + | |
| 9 | 13 | Page<Video> getList(VideoSearchDto dto); | 
| 10 | 14 | |
| 11 | 15 | Video getDetail(int id); | ... | ... | 
src/main/java/com/sincere/student/service/impl/AdvertServiceImpl.java
| ... | ... | @@ -5,6 +5,8 @@ import com.sincere.student.mapper.AdvertMapper; | 
| 5 | 5 | import com.sincere.student.model.Advert; | 
| 6 | 6 | import com.sincere.student.service.AdvertService; | 
| 7 | 7 | import org.springframework.beans.factory.annotation.Autowired; | 
| 8 | +import org.springframework.cache.annotation.CacheEvict; | |
| 9 | +import org.springframework.cache.annotation.Cacheable; | |
| 8 | 10 | import org.springframework.stereotype.Service; | 
| 9 | 11 | |
| 10 | 12 | import java.util.List; | 
| ... | ... | @@ -36,7 +38,7 @@ public class AdvertServiceImpl implements AdvertService { | 
| 36 | 38 | } | 
| 37 | 39 | |
| 38 | 40 | @Override | 
| 39 | - public int create(Advert advert) { | |
| 41 | + public Integer create(Advert advert) { | |
| 40 | 42 | return advertMapper.create(advert); | 
| 41 | 43 | } | 
| 42 | 44 | ... | ... | 
src/main/java/com/sincere/student/service/impl/VideoServiceImpl.java
| ... | ... | @@ -18,6 +18,18 @@ public class VideoServiceImpl implements VideoService { | 
| 18 | 18 | VideoMapper videoMapper ; | 
| 19 | 19 | |
| 20 | 20 | @Override | 
| 21 | + public Page<Video> getUniversityList(VideoSearchDto dto) { | |
| 22 | + Page<Video> page = new Page<>(dto.getPage(),dto.getPageSize()); | |
| 23 | + if(StringUtils.isNotBlank(dto.getUniversityName())){ | |
| 24 | + dto.setUniversityName("%"+dto.getUniversityName()+"%"); | |
| 25 | + } | |
| 26 | + PageHelper.startPage(dto.getPage(),dto.getPageSize()); | |
| 27 | + page.setList(videoMapper.getUniversityList(dto)); | |
| 28 | + page.setCount(videoMapper.getUniversityListCount(dto)); | |
| 29 | + return page; | |
| 30 | + } | |
| 31 | + | |
| 32 | + @Override | |
| 21 | 33 | public Page<Video> getList(VideoSearchDto dto) { | 
| 22 | 34 | Page<Video> page = new Page<>(dto.getPage(),dto.getPageSize()); | 
| 23 | 35 | if(StringUtils.isNotBlank(dto.getUniversityName())){ | ... | ... | 
src/main/java/com/sincere/student/utils/RedisConfig.java
0 → 100644
| ... | ... | @@ -0,0 +1,36 @@ | 
| 1 | +//package com.sincere.student.utils; | |
| 2 | +// | |
| 3 | +//import org.springframework.context.annotation.Bean; | |
| 4 | +//import org.springframework.context.annotation.Configuration; | |
| 5 | +//import org.springframework.data.redis.connection.RedisConnectionFactory; | |
| 6 | +//import org.springframework.data.redis.core.RedisTemplate; | |
| 7 | +//import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; | |
| 8 | +//import org.springframework.data.redis.serializer.RedisSerializer; | |
| 9 | +//import org.springframework.data.redis.serializer.StringRedisSerializer; | |
| 10 | +// | |
| 11 | +//@Configuration | |
| 12 | +//public class RedisConfig { | |
| 13 | +// | |
| 14 | +// @Bean(name = "redisTemplate") | |
| 15 | +// public RedisTemplate<String,Object> redisTemplate(RedisConnectionFactory redisConnectionFactory){ | |
| 16 | +// | |
| 17 | +// RedisTemplate<String,Object> redisTemplate = new RedisTemplate<>(); | |
| 18 | +// //参照StringRedisTemplate内部实现指定序列化器 | |
| 19 | +// redisTemplate.setConnectionFactory(redisConnectionFactory); | |
| 20 | +// redisTemplate.setKeySerializer(keySerializer()); | |
| 21 | +// redisTemplate.setHashKeySerializer(keySerializer()); | |
| 22 | +// redisTemplate.setValueSerializer(valueSerializer()); | |
| 23 | +// redisTemplate.setHashValueSerializer(valueSerializer()); | |
| 24 | +// | |
| 25 | +// return redisTemplate; | |
| 26 | +// } | |
| 27 | +// | |
| 28 | +// private RedisSerializer<String> keySerializer() { | |
| 29 | +// return new StringRedisSerializer(); | |
| 30 | +// } | |
| 31 | +// | |
| 32 | +// //使用Jackson序列化器 | |
| 33 | +// private RedisSerializer<Object> valueSerializer() { | |
| 34 | +// return new GenericJackson2JsonRedisSerializer(); | |
| 35 | +// } | |
| 36 | +//} | ... | ... | 
src/main/resources/application.yaml
| ... | ... | @@ -9,23 +9,21 @@ spring: | 
| 9 | 9 | password: xst200919 | 
| 10 | 10 | url: jdbc:sqlserver://60.190.202.57:14333;database=consultative | 
| 11 | 11 | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver | 
| 12 | - thymeleaf: #thymelea模板配置 | |
| 13 | - prefix: classpath:/templates/ | |
| 14 | - suffix: .html | |
| 15 | - mode: HTML5 | |
| 16 | - encoding: UTF-8 | |
| 17 | - cache: false | |
| 18 | - resources: | |
| 19 | - chain: | |
| 20 | - strategy: | |
| 21 | - content: | |
| 22 | - enabled: true | |
| 23 | - paths: /** | |
| 12 | +# cache: | |
| 13 | +# type: redis | |
| 14 | +# redis: | |
| 15 | +# host: 127.0.0.1 | |
| 16 | +# port: 6379 | |
| 17 | +# password: | |
| 18 | +# lettuce: | |
| 19 | +# pool: | |
| 20 | +# max-active: 8 | |
| 21 | +# database: 0 | |
| 24 | 22 | ##mybatis | 
| 25 | 23 | mybatis: | 
| 26 | 24 | mapper-locations: classpath:mapper/*.xml | 
| 27 | 25 | type-aliases-package: com.sincere.student.model | 
| 28 | 26 | |
| 29 | -Logger: | |
| 27 | +logging: | |
| 30 | 28 | level: | 
| 31 | - com.sincere.student.mapper: info | |
| 32 | 29 | \ No newline at end of file | 
| 30 | + com.sincere.student.mapper: debug | |
| 33 | 31 | \ No newline at end of file | ... | ... | 
| ... | ... | @@ -0,0 +1,95 @@ | 
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<configuration debug="true"> | |
| 3 | + <!-- 项目名称 --> | |
| 4 | + | |
| 5 | + <property name="PROJECT_NAME" value="quartz"/> | |
| 6 | + | |
| 7 | + <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> | |
| 8 | + <property name="LOG_HOME" value="C://log"/> | |
| 9 | + | |
| 10 | + <!-- 控制台输出 --> | |
| 11 | + | |
| 12 | + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | |
| 13 | + <!--<withJansi>true</withJansi>--> | |
| 14 | + | |
| 15 | + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | |
| 16 | + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> | |
| 17 | + | |
| 18 | + <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %highlight([%-5level] %logger{50} - %msg%n)</pattern> | |
| 19 | + | |
| 20 | + <charset>UTF-8</charset> | |
| 21 | + | |
| 22 | + </encoder> | |
| 23 | + | |
| 24 | + </appender> | |
| 25 | + | |
| 26 | + <!-- 按照每天生成日志文件 --> | |
| 27 | + | |
| 28 | + <appender name="SYSTEM_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
| 29 | + <!-- 过滤器,只打印ERROR级别的日志 --> | |
| 30 | + | |
| 31 | + <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> | |
| 32 | + <!--日志文件输出的文件名--> | |
| 33 | + | |
| 34 | + <FileNamePattern>${LOG_HOME}/${PROJECT_NAME}/%d{yyyy-MM-dd}.%i.log</FileNamePattern> | |
| 35 | + <!--日志文件保留天数--> | |
| 36 | + | |
| 37 | + <MaxHistory>30</MaxHistory> | |
| 38 | + <!--日志文件最大的大小--> | |
| 39 | + | |
| 40 | + <MaxFileSize>100MB</MaxFileSize> | |
| 41 | + | |
| 42 | + </rollingPolicy> | |
| 43 | + | |
| 44 | + | |
| 45 | + <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> | |
| 46 | + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> | |
| 47 | + | |
| 48 | + <pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] [%-5level] %logger{50} - %msg%n</pattern> | |
| 49 | + | |
| 50 | + <charset>UTF-8</charset> | |
| 51 | + | |
| 52 | + </encoder> | |
| 53 | + | |
| 54 | + </appender> | |
| 55 | + | |
| 56 | + <logger name="system_error" additivity="true"> | |
| 57 | + | |
| 58 | + <appender-ref ref="SYSTEM_FILE"/> | |
| 59 | + | |
| 60 | + </logger> | |
| 61 | + | |
| 62 | + <!-- 设置Spring&Hibernate日志输出级别 --> | |
| 63 | + | |
| 64 | + <logger name="org.springframework" level="WARN"/> | |
| 65 | + | |
| 66 | + <logger name="org.mybatis" level="WARN"/> | |
| 67 | + | |
| 68 | + <logger name="com.ibatis" level="DEBUG"/> | |
| 69 | + | |
| 70 | + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG"/> | |
| 71 | + | |
| 72 | + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG"/> | |
| 73 | + | |
| 74 | + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG"/> | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + <logger name="java.sql.Connection" level="DEBUG"/> | |
| 79 | + | |
| 80 | + <logger name="java.sql.Statement" level="DEBUG"/> | |
| 81 | + | |
| 82 | + <logger name="java.sql.PreparedStatement" level="DEBUG"/> | |
| 83 | + | |
| 84 | + <logger name="com.sincere.smartSearch.mapper" level="DEBUG"/> | |
| 85 | + <!-- 开发环境下的日志配置 --> | |
| 86 | + | |
| 87 | + <root level="INFO"> | |
| 88 | + | |
| 89 | + <appender-ref ref="CONSOLE"/> | |
| 90 | + | |
| 91 | + <appender-ref ref="SYSTEM_FILE"/> | |
| 92 | + | |
| 93 | + </root> | |
| 94 | + | |
| 95 | +</configuration> | ... | ... | 
src/main/resources/mapper/UniversityConsultMapper.xml
| ... | ... | @@ -46,7 +46,7 @@ | 
| 46 | 46 | </select> | 
| 47 | 47 | |
| 48 | 48 | <select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap"> | 
| 49 | - select DISTINCT c.id , info.id as universityId , c.img_url ,c.sort , info.name , info.code from university_consult c | |
| 49 | + select DISTINCT c.id , info.id as universityId , c.img_url ,c.sort , info.name , info.code ,c.status from university_consult c | |
| 50 | 50 | join university_info info on c.university_id = info.id | 
| 51 | 51 | join university_relate_major r on info.id = r.university_id | 
| 52 | 52 | join university_major m on m.id = r.major_id | ... | ... | 
src/main/resources/mapper/UniversityMapper.xml
| ... | ... | @@ -13,6 +13,7 @@ | 
| 13 | 13 | <result column="level" property="level"/> | 
| 14 | 14 | <result column="create_time" property="createTime"/> | 
| 15 | 15 | <result column="phone" property="phone"/> | 
| 16 | + <result column="logo_url" property="logoUrl"/> | |
| 16 | 17 | </resultMap> | 
| 17 | 18 | |
| 18 | 19 | <select id="getListCount" parameterType="com.sincere.student.dto.UniversitySearchDto" resultType="java.lang.Integer"> | 
| ... | ... | @@ -34,8 +35,8 @@ | 
| 34 | 35 | </select> | 
| 35 | 36 | |
| 36 | 37 | <insert id="create" parameterType="com.sincere.student.model.University" > | 
| 37 | - insert into university_info (name,code,university_type,department,province,city,level,create_time,phone) | |
| 38 | - values (#{name},#{code},#{universityType},#{department},#{province},#{city},#{level},GETDATE(),#{phone}) | |
| 38 | + insert into university_info (name,code,university_type,department,province,city,level,create_time,phone,logo_url) | |
| 39 | + values (#{name},#{code},#{universityType},#{department},#{province},#{city},#{level},GETDATE(),#{phone},#{logoUrl}) | |
| 39 | 40 | </insert> | 
| 40 | 41 | |
| 41 | 42 | <delete id="delete" parameterType="java.lang.Integer"> | 
| ... | ... | @@ -69,6 +70,9 @@ | 
| 69 | 70 | <if test="phone!=null"> | 
| 70 | 71 | phone=#{phone}, | 
| 71 | 72 | </if> | 
| 73 | + <if test="logoUrl!=null"> | |
| 74 | + logo_url=#{logoUrl}, | |
| 75 | + </if> | |
| 72 | 76 | </trim> | 
| 73 | 77 | where id = #{id} | 
| 74 | 78 | </update> | ... | ... | 
src/main/resources/mapper/VideoMapper.xml
| ... | ... | @@ -9,27 +9,71 @@ | 
| 9 | 9 | <result column="video_url" property="videoUrl"/> | 
| 10 | 10 | <result column="sort" property="sort"/> | 
| 11 | 11 | <result column="create_time" property="createTime"/> | 
| 12 | - <result column="name" property="universityName"/> | |
| 13 | - <result column="code" property="universityCode"/> | |
| 12 | + <result column="name" property="name"/> | |
| 13 | + <result column="code" property="code"/> | |
| 14 | 14 | <result column="status" property="status" /> | 
| 15 | + <result column="logo_url" property="imgUrl" /> | |
| 15 | 16 | </resultMap> | 
| 16 | 17 | |
| 17 | 18 | <select id="getById" parameterType="java.lang.Integer" resultMap="VideoMap"> | 
| 18 | 19 | select * from university_video where id = #{id} | 
| 19 | 20 | </select> | 
| 20 | 21 | |
| 22 | + | |
| 23 | + <select id="getUniversityListCount" parameterType="com.sincere.student.dto.VideoSearchDto" resultType="java.lang.Integer"> | |
| 24 | + select count( distinct (v.university_id)) from university_video v join university_info info on v.university_id = info.id | |
| 25 | + <where> | |
| 26 | + <if test="columnType != 0"> | |
| 27 | + and v.column_type = #{columnType} | |
| 28 | + </if> | |
| 29 | + <if test="columnType == 0"> | |
| 30 | + and 1 = 1 | |
| 31 | + </if> | |
| 32 | + <if test="universityId != 0"> | |
| 33 | + and info.id = #{universityId} | |
| 34 | + </if> | |
| 35 | + <if test="status == 1"> | |
| 36 | + and status = 1 | |
| 37 | + </if> | |
| 38 | + <if test="status != 1"> | |
| 39 | + and 1 = 1 | |
| 40 | + </if> | |
| 41 | + </where> | |
| 42 | + </select> | |
| 43 | + | |
| 44 | + <select id="getUniversityList" parameterType="com.sincere.student.dto.VideoSearchDto" resultMap="VideoMap"> | |
| 45 | + select distinct v.university_id , info.name,info.code ,info.logo_url from university_video v join university_info info on v.university_id = info.id | |
| 46 | + <where> | |
| 47 | + <if test="columnType != 0"> | |
| 48 | + and v.column_type = #{columnType} | |
| 49 | + </if> | |
| 50 | + <if test="universityId != 0"> | |
| 51 | + and info.id = #{universityId} | |
| 52 | + </if> | |
| 53 | + <if test="status == 1"> | |
| 54 | + and status = 1 | |
| 55 | + </if> | |
| 56 | + <if test="status != 1"> | |
| 57 | + and 1 = 1 | |
| 58 | + </if> | |
| 59 | + </where> | |
| 60 | + </select> | |
| 61 | + | |
| 21 | 62 | <select id="getListCount" parameterType="com.sincere.student.dto.VideoSearchDto" resultType="java.lang.Integer"> | 
| 22 | 63 | select count(0) from university_video v join university_info info on v.university_id = info.id | 
| 23 | 64 | <where> | 
| 24 | - <if test="columnTypeId != 0"> | |
| 25 | - and v.column_type = #{columnTypeId} | |
| 65 | + <if test="columnType != 0"> | |
| 66 | + and v.column_type = #{columnType} | |
| 26 | 67 | </if> | 
| 27 | - <if test="universityName == 0"> | |
| 68 | + <if test="columnType == 0"> | |
| 28 | 69 | and 1 = 1 | 
| 29 | 70 | </if> | 
| 30 | 71 | <if test="universityName != null and universityName != ''"> | 
| 31 | 72 | and info.name like #{universityName} | 
| 32 | 73 | </if> | 
| 74 | + <if test="universityId != 0"> | |
| 75 | + and info.id = #{universityId} | |
| 76 | + </if> | |
| 33 | 77 | <if test="status == 1"> | 
| 34 | 78 | and status = 1 | 
| 35 | 79 | </if> | 
| ... | ... | @@ -39,11 +83,14 @@ | 
| 39 | 83 | </where> | 
| 40 | 84 | </select> | 
| 41 | 85 | |
| 42 | - <select id="getList" parameterType="com.sincere.student.dto.ArticleSearchDto" resultMap="VideoMap"> | |
| 43 | - select v.*,info.name,info.code from university_video v join university_info info on v.university_id = info.id | |
| 86 | + <select id="getList" parameterType="com.sincere.student.dto.VideoSearchDto" resultMap="VideoMap"> | |
| 87 | + select v.*,info.name,info.code ,info.logo_url from university_video v join university_info info on v.university_id = info.id | |
| 44 | 88 | <where> | 
| 45 | - <if test="columnTypeId != 0"> | |
| 46 | - and v.column_type = #{columnTypeId} | |
| 89 | + <if test="columnType != 0"> | |
| 90 | + and v.column_type = #{columnType} | |
| 91 | + </if> | |
| 92 | + <if test="universityId != 0"> | |
| 93 | + and info.id = #{universityId} | |
| 47 | 94 | </if> | 
| 48 | 95 | <if test="universityName != null and universityName != ''"> | 
| 49 | 96 | and info.name like #{universityName} | ... | ... |