Commit b94115144a53adfb1fbe8a9c1908eecea4b2c237

Authored by 陈杰
0 parents
Exists in master

first

Showing 113 changed files with 6344 additions and 0 deletions   Show diff stats
pom.xml 0 → 100644
  1 +++ a/pom.xml
... ... @@ -0,0 +1,211 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5 + <parent>
  6 + <groupId>org.springframework.boot</groupId>
  7 + <artifactId>spring-boot-starter-parent</artifactId>
  8 + <version>2.1.6.RELEASE</version>
  9 + </parent>
  10 + <modelVersion>4.0.0</modelVersion>
  11 +
  12 + <artifactId>EnrollStudent_independent</artifactId>
  13 +
  14 + <dependencies>
  15 + <dependency>
  16 + <groupId>org.apache.httpcomponents</groupId>
  17 + <artifactId>httpclient</artifactId>
  18 + <version>4.3</version>
  19 + </dependency>
  20 + <dependency>
  21 + <groupId>org.apache.httpcomponents</groupId>
  22 + <artifactId>httpmime</artifactId>
  23 + <version>4.5.3</version>
  24 + </dependency>
  25 + <dependency>
  26 + <groupId>org.thymeleaf</groupId>
  27 + <artifactId>thymeleaf</artifactId>
  28 + <version>3.0.9.RELEASE</version>
  29 + </dependency>
  30 + <dependency>
  31 + <groupId>org.thymeleaf</groupId>
  32 + <artifactId>thymeleaf-spring4</artifactId>
  33 + <version>3.0.9.RELEASE</version>
  34 + </dependency>
  35 + <dependency>
  36 + <groupId>org.springframework.boot</groupId>
  37 + <artifactId>spring-boot-starter-thymeleaf</artifactId>
  38 + </dependency>
  39 + <dependency>
  40 + <groupId>org.mybatis.generator</groupId>
  41 + <artifactId>mybatis-generator-core</artifactId>
  42 + <version>1.3.5</version>
  43 + </dependency>
  44 + <dependency>
  45 + <groupId>org.apache.poi</groupId>
  46 + <artifactId>poi</artifactId>
  47 + <version>4.1.0</version>
  48 + </dependency>
  49 + <dependency>
  50 + <groupId>org.apache.poi</groupId>
  51 + <artifactId>poi-ooxml</artifactId>
  52 + <version>4.1.0</version>
  53 + </dependency>
  54 + <dependency>
  55 + <groupId>org.slf4j</groupId>
  56 + <artifactId>slf4j-api</artifactId>
  57 + <version>1.7.13</version>
  58 + </dependency>
  59 + <dependency>
  60 + <groupId>com.github.pagehelper</groupId>
  61 + <artifactId>pagehelper-spring-boot-starter</artifactId>
  62 + <version>1.2.12</version>
  63 + </dependency>
  64 + <dependency>
  65 + <groupId>com.alibaba</groupId>
  66 + <artifactId>fastjson</artifactId>
  67 + <version>1.2.16</version>
  68 + </dependency>
  69 + <dependency>
  70 + <groupId>com.nimbusds</groupId>
  71 + <artifactId>nimbus-jose-jwt</artifactId>
  72 + <version>6.0</version>
  73 + </dependency>
  74 + <dependency>
  75 + <groupId>org.springframework.boot</groupId>
  76 + <artifactId>spring-boot-starter-test</artifactId>
  77 + <scope>test</scope>
  78 + </dependency>
  79 + <dependency>
  80 + <groupId>org.apache.commons</groupId>
  81 + <artifactId>commons-lang3</artifactId>
  82 + <version>3.3.2</version>
  83 + </dependency>
  84 + <dependency>
  85 + <groupId>org.mybatis.spring.boot</groupId>
  86 + <artifactId>mybatis-spring-boot-starter</artifactId>
  87 + <version>1.3.0</version>
  88 + </dependency>
  89 + <dependency>
  90 + <groupId>com.microsoft.sqlserver</groupId>
  91 + <artifactId>mssql-jdbc</artifactId>
  92 + <version>6.4.0.jre8</version>
  93 + </dependency>
  94 + <dependency>
  95 + <groupId>org.springframework.boot</groupId>
  96 + <artifactId>spring-boot-starter-web</artifactId>
  97 + </dependency>
  98 + <dependency>
  99 + <groupId>org.apache.commons</groupId>
  100 + <artifactId>commons-lang3</artifactId>
  101 + <version>3.3.2</version>
  102 + </dependency>
  103 + <dependency>
  104 + <groupId>io.springfox</groupId>
  105 + <artifactId>springfox-swagger2</artifactId>
  106 + <version>2.6.1</version>
  107 + </dependency>
  108 + <dependency>
  109 + <groupId>io.springfox</groupId>
  110 + <artifactId>springfox-swagger-ui</artifactId>
  111 + <version>2.6.1</version>
  112 + </dependency>
  113 + </dependencies>
  114 +
  115 + <build>
  116 + <!--打包文件名-->
  117 + <finalName>student</finalName>
  118 + <!--打包方式-->
  119 + <plugins>
  120 +
  121 +
  122 + <plugin>
  123 + <groupId>org.mybatis.generator</groupId>
  124 + <artifactId>mybatis-generator-maven-plugin</artifactId>
  125 + <version>1.3.5</version>
  126 + <configuration>
  127 + <verbose>true</verbose>
  128 + <overwrite>true</overwrite>
  129 + </configuration>
  130 + </plugin>
  131 +
  132 + <!-- 设置编译版本 -->
  133 + <plugin>
  134 + <groupId>org.apache.maven.plugins</groupId>
  135 + <artifactId>maven-compiler-plugin</artifactId>
  136 + <version>3.1</version>
  137 + <configuration>
  138 + <source>1.8</source>
  139 + <target>1.8</target>
  140 + <encoding>UTF-8</encoding>
  141 + </configuration>
  142 + </plugin>
  143 + <!-- 打包jar文件时,配置manifest文件,加入lib包的jar依赖 -->
  144 + <!-- 本地启动需要注释-->
  145 + <plugin>
  146 + <groupId>org.apache.maven.plugins</groupId>
  147 + <artifactId>maven-jar-plugin</artifactId>
  148 + <configuration>
  149 + <archive>
  150 + <manifest>
  151 + <mainClass>com.sincere.student.StudentApplication</mainClass>
  152 + <addClasspath>true</addClasspath>
  153 + <classpathPrefix>lib/</classpathPrefix>
  154 + </manifest>
  155 + <manifestEntries>
  156 + <Class-Path>./config/</Class-Path>
  157 + </manifestEntries>
  158 + </archive>
  159 + <excludes>
  160 + <exclude>config/**</exclude>
  161 + </excludes>
  162 + <classesDirectory></classesDirectory>
  163 + </configuration>
  164 + </plugin>
  165 + <!-- 拷贝依赖的jar包到lib目录 -->
  166 + <plugin>
  167 + <groupId>org.apache.maven.plugins</groupId>
  168 + <artifactId>maven-dependency-plugin</artifactId>
  169 + <executions>
  170 + <execution>
  171 + <id>copy</id>
  172 + <phase>package</phase>
  173 + <goals>
  174 + <goal>copy-dependencies</goal>
  175 + </goals>
  176 + <configuration>
  177 + <outputDirectory>
  178 + ${project.build.directory}/lib
  179 + </outputDirectory>
  180 + </configuration>
  181 + </execution>
  182 + </executions>
  183 + </plugin>
  184 + <!-- 解决资源文件的编码问题 -->
  185 + <plugin>
  186 + <groupId>org.apache.maven.plugins</groupId>
  187 + <artifactId>maven-resources-plugin</artifactId>
  188 + <version>2.5</version>
  189 + <configuration>
  190 + <encoding>UTF-8</encoding>
  191 + </configuration>
  192 + </plugin>
  193 + <!-- 打包source文件为jar文件 -->
  194 + <plugin>
  195 + <artifactId>maven-source-plugin</artifactId>
  196 + <version>2.2</version>
  197 + <configuration>
  198 + <attach>true</attach>
  199 + </configuration>
  200 + <executions>
  201 + <execution>
  202 + <phase>compile</phase>
  203 + <goals>
  204 + <goal>jar</goal>
  205 + </goals>
  206 + </execution>
  207 + </executions>
  208 + </plugin>
  209 + </plugins>
  210 + </build>
  211 +</project>
0 212 \ No newline at end of file
... ...
src/main/java/com/sincere/student/StudentApplication.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/StudentApplication.java
... ... @@ -0,0 +1,16 @@
  1 +package com.sincere.student;
  2 +
  3 +import org.mybatis.spring.annotation.MapperScan;
  4 +import org.springframework.boot.SpringApplication;
  5 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  6 +import org.springframework.cache.annotation.EnableCaching;
  7 +
  8 +@EnableCaching
  9 +@SpringBootApplication
  10 +@MapperScan("com.sincere.student.mapper")
  11 +public class StudentApplication {
  12 +
  13 + public static void main(String[] args) {
  14 + SpringApplication.run(StudentApplication.class, args);
  15 + }
  16 +}
... ...
src/main/java/com/sincere/student/Swagger2.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/Swagger2.java
... ... @@ -0,0 +1,51 @@
  1 +package com.sincere.student;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.context.annotation.Configuration;
  5 +import springfox.documentation.builders.ApiInfoBuilder;
  6 +import springfox.documentation.builders.ParameterBuilder;
  7 +import springfox.documentation.builders.PathSelectors;
  8 +import springfox.documentation.builders.RequestHandlerSelectors;
  9 +import springfox.documentation.schema.ModelRef;
  10 +import springfox.documentation.service.ApiInfo;
  11 +import springfox.documentation.service.Parameter;
  12 +import springfox.documentation.spi.DocumentationType;
  13 +import springfox.documentation.spring.web.plugins.Docket;
  14 +import springfox.documentation.swagger2.annotations.EnableSwagger2;
  15 +
  16 +import java.util.ArrayList;
  17 +import java.util.List;
  18 +
  19 +@EnableSwagger2
  20 +@Configuration //让Spring来加载该类配置
  21 +public class Swagger2 {
  22 +
  23 + @Bean
  24 + public Docket createRestApi() {
  25 + ParameterBuilder ticketPar = new ParameterBuilder();
  26 + List<Parameter> pars = new ArrayList<Parameter>();
  27 + ticketPar.name("X-Authorization").description("user token")
  28 + .modelRef(new ModelRef("string")).parameterType("header")
  29 + .required(false).build(); //header中的ticket参数非必填,传空也可以
  30 + pars.add(ticketPar.build());
  31 +
  32 +
  33 + return new Docket(DocumentationType.SWAGGER_2)
  34 + .apiInfo(apiInfo())
  35 + .enableUrlTemplating(true)
  36 + .select()
  37 + // 扫描所有有注解的api,用这种方式更灵活
  38 + .apis(RequestHandlerSelectors.basePackage("com.sincere.student.controller"))
  39 + .paths(PathSelectors.any())
  40 + .build().globalOperationParameters(pars);
  41 +
  42 + }
  43 + private ApiInfo apiInfo() {
  44 + return new ApiInfoBuilder()
  45 + .title("Spring Boot中使用Swagger2构建RESTful APIs")
  46 + .description("接口文档")
  47 + .termsOfServiceUrl("")
  48 + .version("1.0")
  49 + .build();
  50 + }
  51 +}
... ...
src/main/java/com/sincere/student/access/MemberAccess.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/access/MemberAccess.java
... ... @@ -0,0 +1,12 @@
  1 +package com.sincere.student.access;
  2 +
  3 +import java.lang.annotation.*;
  4 +/**
  5 + * 方法上有这个注解就表示需要登录
  6 + */
  7 +@Documented
  8 +@Retention(RetentionPolicy.RUNTIME)//
  9 +@Target({ElementType.METHOD, ElementType.TYPE})//该注解修饰类中的方法
  10 +@Inherited
  11 +public @interface MemberAccess {
  12 +}
... ...
src/main/java/com/sincere/student/access/MemberInterceptor.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/access/MemberInterceptor.java
... ... @@ -0,0 +1,62 @@
  1 +package com.sincere.student.access;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.sincere.student.dto.BaseDto;
  5 +import com.sincere.student.utils.ResultException;
  6 +import com.sincere.student.utils.TokenUtils;
  7 +import org.springframework.web.method.HandlerMethod;
  8 +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
  9 +
  10 +import javax.servlet.http.HttpServletRequest;
  11 +import javax.servlet.http.HttpServletResponse;
  12 +import java.io.OutputStream;
  13 +import java.lang.annotation.Annotation;
  14 +import java.lang.reflect.Method;
  15 +
  16 +
  17 +public class MemberInterceptor extends HandlerInterceptorAdapter {
  18 +
  19 + @Override
  20 + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
  21 + if (handler instanceof HandlerMethod) {
  22 +
  23 + HandlerMethod myHandlerMethod = (HandlerMethod) handler;
  24 + Method method= myHandlerMethod.getMethod();
  25 + Annotation methodAnnotation=method.getAnnotation(MemberAccess.class);//方法上有该标记
  26 + if(methodAnnotation != null){
  27 + boolean isLogin = isLogin(request) ;
  28 + if(isLogin){
  29 + return true;
  30 + }else{//未登录
  31 + //Ajax请求返回JSON
  32 + BaseDto repVo = new BaseDto();
  33 + repVo.setSuccess(false);
  34 + repVo.setMessage("请先登录");
  35 + String data = JSON.toJSONString(repVo);
  36 + response.setHeader("content-type", "text/html;charset=UTF-8");
  37 + OutputStream out = response.getOutputStream();
  38 + out.write(data.getBytes("UTF-8"));
  39 + return false;
  40 + }
  41 + }
  42 + }
  43 + return true;
  44 + }
  45 +
  46 + private boolean isLogin(HttpServletRequest request) throws Exception{
  47 + try {
  48 + String token = request.getHeader("X-Authorization");
  49 + if( token != null){
  50 + try{
  51 + TokenUtils.validToken(token);
  52 + return true;
  53 + }catch (ResultException e){
  54 +
  55 + }
  56 + }
  57 + }catch (Exception e){
  58 + return false;
  59 + }
  60 + return false;
  61 + }
  62 +}
... ...
src/main/java/com/sincere/student/access/StaticAdapter.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/access/StaticAdapter.java
... ... @@ -0,0 +1,22 @@
  1 +package com.sincere.student.access;
  2 +
  3 +import org.springframework.context.annotation.Bean;
  4 +import org.springframework.context.annotation.Configuration;
  5 +import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
  6 +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
  7 +
  8 +@Configuration
  9 +public class StaticAdapter extends WebMvcConfigurerAdapter {
  10 +
  11 + @Bean
  12 + public MemberInterceptor getMemberInterceptor() {
  13 + return new MemberInterceptor();
  14 + }
  15 +
  16 + //添加拦截器
  17 + @Override
  18 + public void addInterceptors(InterceptorRegistry registry) {
  19 + registry.addInterceptor(getMemberInterceptor());
  20 + super.addInterceptors(registry);
  21 + }
  22 +}
... ...
src/main/java/com/sincere/student/controller/AdminController.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/controller/AdminController.java
... ... @@ -0,0 +1,593 @@
  1 +package com.sincere.student.controller;
  2 +
  3 +import com.sincere.student.access.MemberAccess;
  4 +import com.sincere.student.dto.*;
  5 +import com.sincere.student.enums.AdvertEnums;
  6 +import com.sincere.student.enums.ColumnEnums;
  7 +import com.sincere.student.enums.ParameterUtils;
  8 +import com.sincere.student.model.*;
  9 +import com.sincere.student.service.*;
  10 +import com.sincere.student.utils.ExcelUtils;
  11 +import com.sincere.student.utils.Page;
  12 +import com.sincere.student.utils.ResultException;
  13 +import com.sincere.student.utils.TokenUtils;
  14 +import io.swagger.annotations.ApiOperation;
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.web.bind.annotation.*;
  17 +
  18 +import java.util.ArrayList;
  19 +import java.util.List;
  20 +
  21 +@RestController
  22 +@RequestMapping("admin")
  23 +public class AdminController {
  24 +
  25 + @Autowired
  26 + ColumnService columnService ;
  27 +
  28 + @Autowired
  29 + AdvertService advertService ;
  30 +
  31 + @Autowired
  32 + ArticleService articleService ;
  33 +
  34 + @Autowired
  35 + MajorService majorService ;
  36 +
  37 + @Autowired
  38 + UniversityService universityService ;
  39 +
  40 + @Autowired
  41 + ParameterService parameterService;
  42 +
  43 + @Autowired
  44 + VideoService videoService ;
  45 +
  46 + @Autowired
  47 + ConsultService consultService ;
  48 +
  49 + @Autowired
  50 + UserService userService ;
  51 +
  52 + @Autowired
  53 + MessageService messageService ;
  54 +
  55 + @Autowired
  56 + SubmitService submitService;
  57 +
  58 + /**
  59 + * 投档线
  60 + */
  61 + @MemberAccess
  62 + @ApiOperation("投档线列表接口")
  63 + @RequestMapping(value = "/submit/getList" , method = RequestMethod.POST)
  64 + public BaseDto<Page<SubmitFile>> getFileList(@RequestBody MessageSearchDto messageSearchDto){
  65 + BaseDto<Page<SubmitFile>> result = new BaseDto<>();
  66 + result.setData(submitService.getAdminList(messageSearchDto));
  67 + return result ;
  68 + }
  69 +
  70 + @MemberAccess
  71 + @ApiOperation("投档线创建接口")
  72 + @RequestMapping(value = "/submit/createFile" , method = RequestMethod.POST)
  73 + public BaseDto createFile(@RequestBody SubmitFile submitFile){
  74 + BaseDto result = new BaseDto();
  75 + try{
  76 + List<Point> list = ExcelUtils.analysisExcel(submitFile.getFileUrl());
  77 + List<Point> points = new ArrayList<>();
  78 + for(Point point : list){
  79 + Integer universityId = universityService.selectByName(point.getUniversityName());
  80 + if(universityId == null){
  81 + throw new ResultException(902,point.getUniversityName()+"不存在");
  82 + }
  83 + point.setUniversityId(universityId);
  84 + Integer majorId = universityService.selectIdByMajor(point.getMajor(),universityId);
  85 + if(majorId == null){
  86 + throw new ResultException(902,point.getUniversityName()+"-"+point.getMajor()+"关系不存在");
  87 + }
  88 + point.setMajorId(majorId);
  89 + points.add(point);
  90 + }
  91 + submitFile.setList(points);
  92 + submitService.create(submitFile);
  93 + }catch (ResultException e){
  94 + result.setSuccess(false);
  95 + result.setMessage(e.getMessage());
  96 + }
  97 + return result ;
  98 + }
  99 +
  100 +
  101 + /**
  102 + * 留言板
  103 + */
  104 + @MemberAccess
  105 + @ApiOperation("留言板列表接口")
  106 + @RequestMapping(value = "/message/getList" , method = RequestMethod.POST)
  107 + public BaseDto<Page<Message>> getMessageList(@RequestBody MessageSearchDto messageSearchDto){
  108 + BaseDto<Page<Message>> result = new BaseDto<>();
  109 + result.setData(messageService.getList(messageSearchDto));
  110 + return result ;
  111 + }
  112 +
  113 + @MemberAccess
  114 + @ApiOperation("留言板详情,管理回复 接口")
  115 + @RequestMapping(value = "/message/getDetail" , method = RequestMethod.POST)
  116 + public BaseDto<Message> getMessageDetail(@RequestBody IdDto idDto){
  117 + BaseDto<Message> result = new BaseDto<>();
  118 + result.setData(messageService.getDetail(idDto.getId()));
  119 + return result ;
  120 + }
  121 +
  122 + @MemberAccess
  123 + @ApiOperation("回复接口")
  124 + @RequestMapping(value = "/message/reply" , method = RequestMethod.POST)
  125 + public BaseDto getMessageDetail(@RequestBody Reply reply){
  126 + messageService.reply(reply);
  127 + return new BaseDto() ;
  128 + }
  129 +
  130 + @MemberAccess
  131 + @ApiOperation("删除某个回复 接口")
  132 + @RequestMapping(value = "/message/deleteReply" , method = RequestMethod.POST)
  133 + public BaseDto<Message> deleteReply(@RequestBody IdDto idDto){
  134 + messageService.deleteReply(idDto.getId());
  135 + return new BaseDto<>() ;
  136 + }
  137 +
  138 + @MemberAccess
  139 + @ApiOperation("删除留言 接口")
  140 + @RequestMapping(value = "/message/deleteMessage" , method = RequestMethod.POST)
  141 + public BaseDto<Message> deleteMessage(@RequestBody IdDto idDto){
  142 + messageService.deleteMessage(idDto.getId());
  143 + return new BaseDto<>() ;
  144 + }
  145 +
  146 + /**
  147 + * 登录 修改密码
  148 + */
  149 + @ApiOperation("登录")
  150 + @RequestMapping(value = "/login" , method = RequestMethod.POST)
  151 + public BaseDto<String> login(@RequestBody SysUser sysUser){
  152 + BaseDto<String> result = new BaseDto<>() ;
  153 + SysUser user = userService.getByUser();
  154 + if(user.getUserName().equals(sysUser.getUserName()) && user.getPassword().equals(sysUser.getPassword())){
  155 + String token = TokenUtils.buildToken(user.getUserName());
  156 + result.setData(token);
  157 + }else {
  158 + result.setSuccess(false);
  159 + result.setMessage("账号密码错误");
  160 + }
  161 + return result ;
  162 + }
  163 +
  164 + @MemberAccess
  165 + @ApiOperation("修改密码")
  166 + @RequestMapping(value = "/updatePassword" , method = RequestMethod.POST)
  167 + public BaseDto updatePassword(@RequestBody SysUser sysUser){
  168 + BaseDto result = new BaseDto() ;
  169 + SysUser user = userService.getByUser();
  170 + user.setPassword(sysUser.getPassword());
  171 + userService.update(sysUser);
  172 + return result ;
  173 + }
  174 +
  175 + /**
  176 + * 招生咨询会
  177 + */
  178 + @MemberAccess
  179 + @ApiOperation("获取招生咨询会相关接口")
  180 + @RequestMapping(value = "/consult/getList" , method = RequestMethod.POST)
  181 + public BaseDto<Page<Consult>> getConsultList(@RequestBody ConsultSearchDto consultSearchDto){
  182 + BaseDto<Page<Consult>> result = new BaseDto<>() ;
  183 + Page<Consult> page = consultService.getList(consultSearchDto);
  184 + result.setData(page);
  185 + return result ;
  186 + }
  187 +
  188 + @MemberAccess
  189 + @ApiOperation("获取招生咨询会详情相关接口")
  190 + @RequestMapping(value = "/consult/getDetail" , method = RequestMethod.POST)
  191 + public BaseDto<Consult> getConsultDetail(@RequestBody IdDto idDto){
  192 + BaseDto<Consult> result = new BaseDto<>() ;
  193 + result.setData(consultService.getDetail(idDto.getId()));
  194 + return result ;
  195 + }
  196 +
  197 + @MemberAccess
  198 + @ApiOperation("新建招生咨询会相关接口")
  199 + @RequestMapping(value = "/consult/createConsult" , method = RequestMethod.POST)
  200 + public BaseDto createConsult(@RequestBody UniversityConsult universityConsult){
  201 + BaseDto result = new BaseDto() ;
  202 + consultService.create(universityConsult);
  203 + return result ;
  204 + }
  205 +
  206 + @MemberAccess
  207 + @ApiOperation("修改招生咨询会相关接口")
  208 + @RequestMapping(value = "/consult/updateConsult" , method = RequestMethod.POST)
  209 + public BaseDto updateConsult(@RequestBody UniversityConsult universityConsult){
  210 + BaseDto result = new BaseDto() ;
  211 + consultService.update(universityConsult);
  212 + return result ;
  213 + }
  214 +
  215 + @MemberAccess
  216 + @ApiOperation("删除招生咨询会(传主键)")
  217 + @RequestMapping(value = "/consult/delete" , method = RequestMethod.POST)
  218 + public BaseDto deleteConsult(@RequestBody IdDto idDto){
  219 + BaseDto result = new BaseDto() ;
  220 + consultService.delete(idDto.getId());
  221 + return result ;
  222 + }
  223 +
  224 + /**
  225 + * 视频
  226 + */
  227 + @MemberAccess
  228 + @ApiOperation("获取视频相关接口")
  229 + @RequestMapping(value = "/video/getList" , method = RequestMethod.POST)
  230 + public BaseDto<Page<Video>> getVideoList(@RequestBody VideoSearchDto videoSearchDto){
  231 + BaseDto<Page<Video>> result = new BaseDto<>() ;
  232 + Page<Video> page = videoService.getList(videoSearchDto);
  233 + result.setData(page);
  234 + return result ;
  235 + }
  236 +
  237 + @MemberAccess
  238 + @ApiOperation("新建视频相关接口")
  239 + @RequestMapping(value = "/video/createVideo" , method = RequestMethod.POST)
  240 + public BaseDto createVideo(@RequestBody Video video){
  241 + BaseDto result = new BaseDto() ;
  242 + videoService.create(video);
  243 + return result ;
  244 + }
  245 +
  246 + @MemberAccess
  247 + @ApiOperation("修改视频相关接口")
  248 + @RequestMapping(value = "/video/updateVideo" , method = RequestMethod.POST)
  249 + public BaseDto updateVideo(@RequestBody Video video){
  250 + BaseDto result = new BaseDto() ;
  251 + videoService.update(video);
  252 + return result ;
  253 + }
  254 +
  255 + @MemberAccess
  256 + @ApiOperation("删除视频(传主键)")
  257 + @RequestMapping(value = "/video/delete" , method = RequestMethod.POST)
  258 + public BaseDto deleteVideo(@RequestBody IdDto idDto){
  259 + BaseDto result = new BaseDto() ;
  260 + videoService.delete(idDto.getId());
  261 + return result ;
  262 + }
  263 +
  264 + /**
  265 + * 联系我们
  266 + */
  267 + @MemberAccess
  268 + @ApiOperation("联系我们")
  269 + @RequestMapping(value = "/linkUs/getLinkUs" , method = RequestMethod.POST)
  270 + public BaseDto<String> getLinkUs(){
  271 + BaseDto<String> result = new BaseDto<>();
  272 + Parameter parameter = parameterService.getByCode(ParameterUtils.link_us) ;
  273 + if(parameter != null){
  274 + result.setData(parameter.getMessage());
  275 + }else {
  276 + result.setSuccess(false);
  277 + result.setMessage("还未设置联系我们的图片");
  278 + }
  279 + return result ;
  280 + }
  281 +
  282 + @MemberAccess
  283 + @ApiOperation("更新联系我们")
  284 + @RequestMapping(value = "/linkUs/updateLinkUs" , method = RequestMethod.POST)
  285 + public BaseDto updateLinkUs(@RequestBody LinkUsDto dto){
  286 + BaseDto result = new BaseDto<>();
  287 + Parameter parameter = parameterService.getByCode(ParameterUtils.link_us) ;
  288 + if(parameter == null){
  289 + parameter = new Parameter();
  290 + parameter.setCode(ParameterUtils.link_us);
  291 + parameter.setMessage(dto.getUrl());
  292 + parameterService.create(parameter);
  293 + }else {
  294 + parameter.setMessage(dto.getUrl());
  295 + parameterService.update(parameter);
  296 + }
  297 + return result ;
  298 + }
  299 +
  300 + /**
  301 + * 高校相关接口
  302 + */
  303 + @MemberAccess
  304 + @ApiOperation("获取高校相关接口")
  305 + @RequestMapping(value = "/university/getUniversityList" , method = RequestMethod.POST)
  306 + public BaseDto<Page<University>> getUniversityList(@RequestBody UniversitySearchDto universitySearchDto){
  307 + BaseDto<Page<University>> result = new BaseDto<>() ;
  308 + Page<University> page = universityService.getList(universitySearchDto);
  309 + result.setData(page);
  310 + return result ;
  311 + }
  312 +
  313 + @MemberAccess
  314 + @ApiOperation("创建高校相关接口")
  315 + @RequestMapping(value = "/university/createUniversity" , method = RequestMethod.POST)
  316 + public BaseDto createUniversity(@RequestBody University university){
  317 + universityService.create(university);
  318 + return new BaseDto() ;
  319 + }
  320 +
  321 + @MemberAccess
  322 + @ApiOperation("更新高校相关接口")
  323 + @RequestMapping(value = "/university/updateUniversity" , method = RequestMethod.POST)
  324 + public BaseDto updateUniversity(@RequestBody University university){
  325 + universityService.update(university);
  326 + return new BaseDto() ;
  327 + }
  328 +
  329 + @MemberAccess
  330 + @ApiOperation("删除高校相关接口")
  331 + @RequestMapping(value = "/university/delete" , method = RequestMethod.POST)
  332 + public BaseDto deleteUniversity(@RequestBody IdDto idDto){
  333 + BaseDto result = new BaseDto() ;
  334 + universityService.delete(idDto.getId());
  335 + return result ;
  336 + }
  337 +
  338 + @MemberAccess
  339 + @ApiOperation("高校添加专业相关接口")
  340 + @RequestMapping(value = "/university/addMajor" , method = RequestMethod.POST)
  341 + public BaseDto addMajor(@RequestBody List<UniversityMajor> list){
  342 + universityService.addMajor(list);
  343 + return new BaseDto();
  344 + }
  345 +
  346 + /**
  347 + * 专业相关接口
  348 + */
  349 + @MemberAccess
  350 + @ApiOperation("获取专业相关接口")
  351 + @RequestMapping(value = "/major/getMajorList" , method = RequestMethod.POST)
  352 + public BaseDto<Page<Major>> getMajorList(@RequestBody MajorSearchDto majorSearchDto){
  353 + BaseDto<Page<Major>> result = new BaseDto<>();
  354 + Page<Major> page = majorService.getList(majorSearchDto);
  355 + result.setData(page);
  356 + return result ;
  357 + }
  358 +
  359 + @MemberAccess
  360 + @ApiOperation("新增专业相关接口")
  361 + @RequestMapping(value = "/major/createMajor" , method = RequestMethod.POST)
  362 + public BaseDto createMajor(@RequestBody Major major){
  363 + if(major.getpId() == 0){
  364 + major.setpId(-1);
  365 + }
  366 + majorService.create(major);
  367 + return new BaseDto() ;
  368 + }
  369 +
  370 + @MemberAccess
  371 + @ApiOperation("修改专业相关接口")
  372 + @RequestMapping(value = "/major/updateMajor" , method = RequestMethod.POST)
  373 + public BaseDto updateMajor(@RequestBody Major major){
  374 + majorService.update(major);
  375 + return new BaseDto() ;
  376 + }
  377 +
  378 + @MemberAccess
  379 + @ApiOperation("删除专业相关接口")
  380 + @RequestMapping(value = "/major/delete" , method = RequestMethod.POST)
  381 + public BaseDto deleteMajor(@RequestBody IdDto idDto){
  382 + BaseDto result = new BaseDto() ;
  383 + MajorSearchDto majorSearchDto = new MajorSearchDto() ;
  384 + majorSearchDto.setPid(idDto.getId());
  385 + Page<Major> page = majorService.getList(majorSearchDto);
  386 + if(page.getCount() == 0){
  387 + majorService.delete(idDto.getId());
  388 + }else {
  389 + result.setSuccess(false);
  390 + result.setMessage("还有下级专业,删除失败");
  391 + }
  392 + return result ;
  393 + }
  394 +
  395 +
  396 +
  397 + /**
  398 + *权威解读(文章广告)相关接口
  399 + */
  400 + @MemberAccess
  401 + @ApiOperation("获取权威解读(文章广告)相关接口")
  402 + @RequestMapping(value = "/article/getList" , method = RequestMethod.POST)
  403 + public BaseDto<Page<Article>> getArticleList(@RequestBody ArticleSearchDto articleSearchDto){
  404 + BaseDto<Page<Article>> result = new BaseDto<>() ;
  405 + Page<Article> page = articleService.getList(articleSearchDto);
  406 + result.setData(page);
  407 + return result ;
  408 + }
  409 +
  410 + @MemberAccess
  411 + @ApiOperation("新建权威解读(文章广告)相关接口")
  412 + @RequestMapping(value = "/article/createArticle" , method = RequestMethod.POST)
  413 + public BaseDto createArticle(@RequestBody Article article){
  414 + BaseDto result = new BaseDto() ;
  415 + articleService.create(article);
  416 + return result ;
  417 + }
  418 +
  419 + @MemberAccess
  420 + @ApiOperation("修改权威解读(文章广告)相关接口")
  421 + @RequestMapping(value = "/article/updateArticle" , method = RequestMethod.POST)
  422 + public BaseDto updateArticle(@RequestBody Article article){
  423 + BaseDto result = new BaseDto() ;
  424 + articleService.update(article);
  425 + return result ;
  426 + }
  427 +
  428 + @MemberAccess
  429 + @ApiOperation("删除权威解读(文章广告)(传主键)")
  430 + @RequestMapping(value = "/article/delete" , method = RequestMethod.POST)
  431 + public BaseDto deleteArticle(@RequestBody IdDto idDto){
  432 + BaseDto result = new BaseDto() ;
  433 + articleService.delete(idDto.getId());
  434 + return result ;
  435 + }
  436 +
  437 +
  438 + /**
  439 + * 广告相关接口
  440 + */
  441 + @MemberAccess
  442 + @ApiOperation("获取开屏图片")
  443 + @RequestMapping(value = "/advert/getScreen" , method = RequestMethod.POST)
  444 + public BaseDto<Advert> getScreen(){
  445 + BaseDto<Advert> result = new BaseDto<>() ;
  446 + result.setData(advertService.getScreen());
  447 + return result ;
  448 + }
  449 +
  450 + @MemberAccess
  451 + @ApiOperation("更新上传开屏图片")
  452 + @RequestMapping(value = "/advert/updateScreen" , method = RequestMethod.POST)
  453 + public BaseDto updateScreen(@RequestBody LinkUsDto dto){
  454 + Advert advert = advertService.getScreen() ;
  455 + if(advert == null){
  456 + Advert temp =new Advert();
  457 + temp.setSort(1);
  458 + temp.setType(AdvertEnums.screen.getType());
  459 + temp.setImgUrl(dto.getUrl());
  460 + advertService.create(temp);
  461 + }else {
  462 + advert.setImgUrl(dto.getUrl());
  463 + advertService.update(advert);
  464 + }
  465 + return new BaseDto() ;
  466 + }
  467 +
  468 + @MemberAccess
  469 + @ApiOperation("获取banner")
  470 + @RequestMapping(value = "/advert/getBanner" , method = RequestMethod.POST)
  471 + public BaseDto<List<Advert>> getBanner(){
  472 + BaseDto<List<Advert>> result = new BaseDto<>() ;
  473 + result.setData(advertService.getBanner());
  474 + return result ;
  475 + }
  476 +
  477 + @MemberAccess
  478 + @ApiOperation("上传banner")
  479 + @RequestMapping(value = "/advert/createBanner" , method = RequestMethod.POST)
  480 + public BaseDto createBanner(@RequestBody Advert advert){
  481 + BaseDto result = new BaseDto();
  482 + advert.setType(AdvertEnums.banner.getType());
  483 + advertService.create(advert);
  484 + return result ;
  485 + }
  486 +
  487 + @MemberAccess
  488 + @ApiOperation("更新banner")
  489 + @RequestMapping(value = "/advert/updateBanner" , method = RequestMethod.POST)
  490 + public BaseDto updateBanner(@RequestBody Advert advert){
  491 + BaseDto result = new BaseDto();
  492 + advert.setType(AdvertEnums.banner.getType());
  493 + advertService.update(advert);
  494 + return result ;
  495 + }
  496 +
  497 + @MemberAccess
  498 + @ApiOperation("删除banner(传主键)")
  499 + @RequestMapping(value = "/advert/delete" , method = RequestMethod.POST)
  500 + public BaseDto deleteBanner(@RequestBody IdDto idDto){
  501 + BaseDto result = new BaseDto() ;
  502 + advertService.delete(idDto.getId());
  503 + return result ;
  504 + }
  505 +
  506 +
  507 + /**
  508 + * 栏目相关接口
  509 + */
  510 + @MemberAccess
  511 + @ApiOperation("获取栏目列表(1 文章 2学校 3视频)")
  512 + @RequestMapping(value = "/column/getList" , method = RequestMethod.POST)
  513 + public BaseDto<List<ColumnType>> getColumnList(@RequestBody ColumnDto columnDto){
  514 + BaseDto<List<ColumnType>> result = new BaseDto<>();
  515 + ColumnEnums columnEnums = ColumnEnums.getByType(columnDto.getType());
  516 + if(columnEnums != null){
  517 + List<ColumnType> data = columnService.getList(columnDto);
  518 + result.setData(data);
  519 + }else {
  520 + result.setSuccess(false);
  521 + result.setMessage("类型不匹配");
  522 + }
  523 + return result ;
  524 + }
  525 +
  526 + @MemberAccess
  527 + @ApiOperation("创建栏目(type : 1 文章 2学校 3视频)")
  528 + @RequestMapping(value = "/column/create" , method = RequestMethod.POST)
  529 + public BaseDto createColumn(@RequestBody ColumnType columnType){
  530 + BaseDto result = new BaseDto() ;
  531 + columnService.create(columnType);
  532 + return result ;
  533 + }
  534 +
  535 + @MemberAccess
  536 + @ApiOperation("更新栏目(type : 1 文章 2学校 3视频)")
  537 + @RequestMapping(value = "/column/update" , method = RequestMethod.POST)
  538 + public BaseDto updateColumn(@RequestBody ColumnType columnType){
  539 + BaseDto result = new BaseDto() ;
  540 + if(columnType.getId() > 0){
  541 + columnService.update(columnType);
  542 + }else {
  543 + result.setSuccess(false);
  544 + result.setMessage("id没传");
  545 + }
  546 + return result ;
  547 + }
  548 +
  549 + @MemberAccess
  550 + @ApiOperation("删除栏目(传主键)")
  551 + @RequestMapping(value = "/column/delete" , method = RequestMethod.POST)
  552 + public BaseDto deleteColumn(@RequestBody IdDto idDto){
  553 + BaseDto result = new BaseDto() ;
  554 + int id = idDto.getId() ;
  555 + ColumnType columnType = columnService.selectDetail(id);
  556 + if(columnType.getType() == ColumnEnums.article.getType()){
  557 + ArticleSearchDto articleSearchDto = new ArticleSearchDto();
  558 + articleSearchDto.setColumnType(columnType.getId());
  559 + articleSearchDto.setPage(1);
  560 + articleSearchDto.setPageSize(10);
  561 + Page<Article> articlePage = articleService.getList(articleSearchDto);
  562 + if(articlePage.getCount() > 0){
  563 + result.setSuccess(false);
  564 + result.setMessage("还有关联的权威解读,无法删除");
  565 + }else {
  566 + columnService.delete(id);
  567 + }
  568 + }else if(columnType.getType() == ColumnEnums.university.getType()){
  569 + Page<Consult> consultPage =consultService.getColumnList(columnType.getId(),1,10);
  570 + if(consultPage.getCount() > 0){
  571 + result.setSuccess(false);
  572 + result.setMessage("还有关联的招生咨询会信息,无法删除");
  573 + }else {
  574 + columnService.delete(id);
  575 + }
  576 + }else if(columnType.getType() == ColumnEnums.video.getType()){
  577 + VideoSearchDto videoSearchDto = new VideoSearchDto();
  578 + videoSearchDto.setColumnTypeId(columnType.getId());
  579 + videoSearchDto.setPage(1);
  580 + videoSearchDto.setPageSize(10);
  581 + Page<Video> videoPage = videoService.getList(videoSearchDto);
  582 + if(videoPage.getCount() > 0){
  583 + result.setSuccess(false);
  584 + result.setMessage("还有关联的视频,无法删除");
  585 + }else {
  586 + columnService.delete(id);
  587 + }
  588 + }else {
  589 + columnService.delete(id);
  590 + }
  591 + return result ;
  592 + }
  593 +}
... ...
src/main/java/com/sincere/student/controller/AppController.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/controller/AppController.java
... ... @@ -0,0 +1,250 @@
  1 +package com.sincere.student.controller;
  2 +
  3 +import com.sincere.student.dto.*;
  4 +import com.sincere.student.dto.app.AppConsult;
  5 +import com.sincere.student.dto.app.ConsultPageDto;
  6 +import com.sincere.student.dto.submit.SubmitLine;
  7 +import com.sincere.student.enums.ColumnEnums;
  8 +import com.sincere.student.enums.ParameterUtils;
  9 +import com.sincere.student.model.*;
  10 +import com.sincere.student.service.*;
  11 +import com.sincere.student.utils.Page;
  12 +import io.swagger.annotations.Api;
  13 +import io.swagger.annotations.ApiOperation;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.web.bind.annotation.*;
  16 +
  17 +import java.util.ArrayList;
  18 +import java.util.List;
  19 +
  20 +@RestController
  21 +@RequestMapping("app")
  22 +public class AppController {
  23 +
  24 +
  25 + @Autowired
  26 + ColumnService columnService ;
  27 +
  28 + @Autowired
  29 + AdvertService advertService ;
  30 +
  31 + @Autowired
  32 + ArticleService articleService ;
  33 +
  34 + @Autowired
  35 + MajorService majorService ;
  36 +
  37 + @Autowired
  38 + UniversityService universityService ;
  39 +
  40 + @Autowired
  41 + ParameterService parameterService;
  42 +
  43 + @Autowired
  44 + VideoService videoService ;
  45 +
  46 + @Autowired
  47 + ConsultService consultService ;
  48 +
  49 + @Autowired
  50 + UserService userService ;
  51 +
  52 + @Autowired
  53 + MessageService messageService ;
  54 +
  55 + @Autowired
  56 + SubmitService submitService;
  57 +
  58 +
  59 + /**
  60 + * 广告相关接口
  61 + */
  62 + @ApiOperation("获取开屏图片")
  63 + @RequestMapping(value = "/advert/getScreen" , method = RequestMethod.POST)
  64 + public BaseDto<Advert> getScreen(){
  65 + BaseDto<Advert> result = new BaseDto<>() ;
  66 + result.setData(advertService.getScreen());
  67 + return result ;
  68 + }
  69 +
  70 + @ApiOperation("获取banner")
  71 + @RequestMapping(value = "/advert/getBanner" , method = RequestMethod.POST)
  72 + public BaseDto<List<Advert>> getBanner(){
  73 + BaseDto<List<Advert>> result = new BaseDto<>() ;
  74 + result.setData(advertService.getBanner());
  75 + return result ;
  76 + }
  77 +
  78 + @ApiOperation("获取首页学校 咨询列表")
  79 + @RequestMapping(value = "/consult/getConsultList" , method = RequestMethod.POST)
  80 + public BaseDto<List<AppConsult>> getConsultList(){
  81 + BaseDto<List<AppConsult>> result = new BaseDto<>();
  82 + List<AppConsult> data = new ArrayList<>();
  83 + ColumnDto columnDto = new ColumnDto();
  84 + columnDto.setType(ColumnEnums.university.getType());
  85 + List<ColumnType> columnTypes = columnService.getList(columnDto);
  86 + if(columnTypes != null && columnTypes.size() > 0){
  87 + for(ColumnType columnType : columnTypes){
  88 + AppConsult appConsult = new AppConsult();
  89 + appConsult.setColumnTypeId(columnType.getId());
  90 + appConsult.setName(columnType.getName());
  91 + appConsult.setList(consultService.getColumnList(columnType.getId(),1,3).getList());
  92 + if(appConsult.getList() != null && appConsult.getList().size() > 0){
  93 + data.add(appConsult);
  94 + if(data.size() == 2){
  95 + break;
  96 + }
  97 + }else {
  98 + continue;
  99 + }
  100 + }
  101 + result.setData(data);
  102 + }else {
  103 + result.setSuccess(false);
  104 + result.setMessage("后台暂未分配招生咨询会栏目");
  105 + }
  106 + return result ;
  107 + }
  108 +
  109 + @ApiOperation("获取首页学校 咨询列表 more")
  110 + @RequestMapping(value = "/consult/getConsultPage" , method = RequestMethod.POST)
  111 + public BaseDto<Page<Consult>> getConsultTypeList(@RequestBody ConsultPageDto consultPageDto){
  112 + BaseDto<Page<Consult>> result = new BaseDto<>();
  113 + result.setData(consultService.getColumnList(consultPageDto.getColumnTypeId(),consultPageDto.getPage(),consultPageDto.getPageSize()));
  114 + return result ;
  115 + }
  116 +
  117 + /**
  118 + * 招生咨询会
  119 + */
  120 + @ApiOperation("获取招生咨询会相关接口")
  121 + @RequestMapping(value = "/consult/getList" , method = RequestMethod.POST)
  122 + public BaseDto<Page<Consult>> getConsultList(@RequestBody ConsultSearchDto consultSearchDto){
  123 + BaseDto<Page<Consult>> result = new BaseDto<>() ;
  124 + Page<Consult> page = consultService.getList(consultSearchDto);
  125 + result.setData(page);
  126 + return result ;
  127 + }
  128 +
  129 + @ApiOperation("获取招生咨询会详情相关接口")
  130 + @RequestMapping(value = "/consult/getDetail/{id}" , method = RequestMethod.POST)
  131 + public BaseDto<Consult> getConsultDetail(@PathVariable("id") int id){
  132 + BaseDto<Consult> result = new BaseDto<>() ;
  133 + result.setData(consultService.getDetail(id));
  134 + return result ;
  135 + }
  136 +
  137 + /**
  138 + * 栏目相关接口
  139 + */
  140 + @ApiOperation("获取栏目列表(1 文章 2学校 3视频)")
  141 + @RequestMapping(value = "/column/getList/{type}" , method = RequestMethod.POST)
  142 + public BaseDto<List<ColumnType>> getColumnList(@PathVariable("type") int type){
  143 + BaseDto<List<ColumnType>> result = new BaseDto<>();
  144 + ColumnEnums columnEnums = ColumnEnums.getByType(type);
  145 + if(columnEnums != null){
  146 + ColumnDto columnDto = new ColumnDto() ;
  147 + columnDto.setType(type);
  148 + List<ColumnType> data = columnService.getList(columnDto);
  149 + result.setData(data);
  150 + }else {
  151 + result.setSuccess(false);
  152 + result.setMessage("类型不匹配");
  153 + }
  154 + return result ;
  155 + }
  156 +
  157 + /**
  158 + *权威解读(文章广告)相关接口
  159 + */
  160 + @ApiOperation("获取权威解读(文章广告)相关接口")
  161 + @RequestMapping(value = "/article/getList" , method = RequestMethod.POST)
  162 + public BaseDto<Page<Article>> getArticleList(@RequestBody ArticleSearchDto articleSearchDto){
  163 + BaseDto<Page<Article>> result = new BaseDto<>() ;
  164 + Page<Article> page = articleService.getList(articleSearchDto);
  165 + result.setData(page);
  166 + return result ;
  167 + }
  168 +
  169 + @ApiOperation("获取权威解读(文章广告)相关接口")
  170 + @RequestMapping(value = "/article/getDetail/{id}" , method = RequestMethod.POST)
  171 + public BaseDto<Article> getDetail(@PathVariable("id") int id){
  172 + BaseDto<Article> result = new BaseDto<>() ;
  173 + result.setData(articleService.selectById(id));
  174 + return result ;
  175 + }
  176 +
  177 + @ApiOperation("获取权威解读(文章广告) 相关咨询 相关接口")
  178 + @RequestMapping(value = "/article/getRelation/{universityId}" , method = RequestMethod.POST)
  179 + public BaseDto<List<Article>> getRelation(@PathVariable("universityId") int universityId){
  180 + BaseDto<List<Article>> result = new BaseDto<>() ;
  181 + result.setData(articleService.getRelationList(universityId));
  182 + return result ;
  183 + }
  184 +
  185 + @ApiOperation("联系我们")
  186 + @RequestMapping(value = "/linkUs/getLinkUs" , method = RequestMethod.POST)
  187 + public BaseDto<String> getLinkUs(){
  188 + BaseDto<String> result = new BaseDto<>();
  189 + Parameter parameter = parameterService.getByCode(ParameterUtils.link_us) ;
  190 + if(parameter != null){
  191 + result.setData(parameter.getMessage());
  192 + }else {
  193 + result.setSuccess(false);
  194 + result.setMessage("还未设置联系我们的图片");
  195 + }
  196 + return result ;
  197 + }
  198 +
  199 + @ApiOperation("留言板,只传page,pageSize")
  200 + @RequestMapping(value = "/message/getList" , method = RequestMethod.POST)
  201 + public BaseDto<Page<Message>> insertMessage(@RequestBody MessageSearchDto messageSearchDto){
  202 + BaseDto<Page<Message>> result = new BaseDto<>();
  203 + result.setData(messageService.getList(messageSearchDto));
  204 + return result ;
  205 + }
  206 +
  207 + @ApiOperation("留言板详情,管理回复 接口")
  208 + @RequestMapping(value = "/message/getDetail/{id}" , method = RequestMethod.POST)
  209 + public BaseDto<Message> getMessageDetail(@PathVariable("id") int id){
  210 + BaseDto<Message> result = new BaseDto<>();
  211 + result.setData(messageService.getDetail(id));
  212 + return result ;
  213 + }
  214 +
  215 + @ApiOperation("留言")
  216 + @RequestMapping(value = "/message/create" , method = RequestMethod.POST)
  217 + public BaseDto insertMessage(@RequestBody Message message){
  218 + messageService.create(message);
  219 + return new BaseDto();
  220 + }
  221 +
  222 +
  223 + @ApiOperation("获取视频相关接口")
  224 + @RequestMapping(value = "/video/getList" , method = RequestMethod.POST)
  225 + public BaseDto<Page<Video>> getVideoList(@RequestBody VideoSearchDto videoSearchDto){
  226 + BaseDto<Page<Video>> result = new BaseDto<>() ;
  227 + Page<Video> page = videoService.getList(videoSearchDto);
  228 + result.setData(page);
  229 + return result ;
  230 + }
  231 +
  232 + @ApiOperation("获取视频相关接口")
  233 + @RequestMapping(value = "/video/getDetail/{id}" , method = RequestMethod.POST)
  234 + public BaseDto<Video> getVideoDetail(@PathVariable ("id") int id){
  235 + BaseDto<Video> result = new BaseDto<>() ;
  236 + result.setData(videoService.getDetail(id));
  237 + return result ;
  238 + }
  239 +
  240 + /**
  241 + * 投档线
  242 + */
  243 + @ApiOperation("投档线列表接口")
  244 + @RequestMapping(value = "/submit/getList" , method = RequestMethod.POST)
  245 + public BaseDto<Page<SubmitLine>> getFileList(@RequestBody PointSearchDto pointSearchDto){
  246 + BaseDto<Page<SubmitLine>> result = new BaseDto<>();
  247 + result.setData(submitService.getAppList(pointSearchDto));
  248 + return result ;
  249 + }
  250 +}
... ...
src/main/java/com/sincere/student/controller/CommonController.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/controller/CommonController.java
... ... @@ -0,0 +1,50 @@
  1 +package com.sincere.student.controller;
  2 +
  3 +import com.sincere.student.model.Area;
  4 +import com.sincere.student.service.CommonService;
  5 +import io.swagger.annotations.ApiOperation;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import java.util.Arrays;
  12 +import java.util.List;
  13 +
  14 +@RestController
  15 +@RequestMapping("/common")
  16 +public class CommonController {
  17 +
  18 + @Autowired
  19 + CommonService commonService ;
  20 +
  21 +
  22 + @ApiOperation("省份")
  23 + @RequestMapping(value = "getProvince",method = RequestMethod.GET)
  24 + public List<Area> getProvince(){
  25 + return commonService.getProvince();
  26 + }
  27 +
  28 + @ApiOperation("市")
  29 + @RequestMapping(value = "getCity",method = RequestMethod.GET)
  30 + public List<Area> getCity(String code){
  31 + return commonService.getCity(code);
  32 + }
  33 +
  34 + @ApiOperation("高校类型")
  35 + @RequestMapping(value = "getUniversityType",method = RequestMethod.GET)
  36 + public List<String> getUniversityType(){
  37 + String[] array = new String[]{"综合类","理工类","师范类","农林类","政法类","医药类"
  38 + ,"财经类","民族类","语言类","艺术类","体育类","军事类","旅游类"};
  39 + List<String> list = Arrays.asList(array);
  40 + return list ;
  41 + }
  42 +
  43 + @ApiOperation("高校教学层次")
  44 + @RequestMapping(value = "getUniversityLevel",method = RequestMethod.GET)
  45 + public List<String> getUniversityLevel(){
  46 + String[] array = new String[]{"本科","高职"};
  47 + List<String> list = Arrays.asList(array);
  48 + return list ;
  49 + }
  50 +}
... ...
src/main/java/com/sincere/student/controller/IndexController.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/controller/IndexController.java
... ... @@ -0,0 +1,60 @@
  1 +package com.sincere.student.controller;
  2 +
  3 +import com.sincere.student.utils.HttpClientUtils;
  4 +import org.springframework.stereotype.Controller;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RequestMethod;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +import org.springframework.web.bind.annotation.ResponseBody;
  9 +import org.springframework.web.multipart.MultipartFile;
  10 +
  11 +import java.io.File;
  12 +import java.io.FileOutputStream;
  13 +import java.io.InputStream;
  14 +import java.io.OutputStream;
  15 +
  16 +@Controller
  17 +public class IndexController {
  18 +
  19 + @RequestMapping("index")
  20 + public String index(){
  21 + return "index" ;
  22 + }
  23 +
  24 + @ResponseBody
  25 + @RequestMapping(value = "upload" ,method = RequestMethod.POST)
  26 + public String upload(@RequestParam("file") MultipartFile file) throws Exception{
  27 + //return file.getOriginalFilename() ;
  28 + return HttpClientUtils.upload("http://121.40.109.21:8083/file-center/file/fileUpload",multipartFileToFile(file),file.getOriginalFilename());
  29 + }
  30 +
  31 + public File multipartFileToFile(MultipartFile file) throws Exception {
  32 +
  33 + File toFile = null;
  34 + if (file.equals("") || file.getSize() <= 0) {
  35 + file = null;
  36 + } else {
  37 + InputStream ins = null;
  38 + ins = file.getInputStream();
  39 + toFile = new File(file.getOriginalFilename());
  40 + inputStreamToFile(ins, toFile);
  41 + ins.close();
  42 + }
  43 + return toFile;
  44 + }
  45 +
  46 + private void inputStreamToFile(InputStream ins, File file) {
  47 + try {
  48 + OutputStream os = new FileOutputStream(file);
  49 + int bytesRead = 0;
  50 + byte[] buffer = new byte[8192];
  51 + while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
  52 + os.write(buffer, 0, bytesRead);
  53 + }
  54 + os.close();
  55 + ins.close();
  56 + } catch (Exception e) {
  57 + e.printStackTrace();
  58 + }
  59 + }
  60 +}
... ...
src/main/java/com/sincere/student/dto/ArticleSearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/ArticleSearchDto.java
... ... @@ -0,0 +1,39 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class ArticleSearchDto extends PageDto{
  8 +
  9 + @ApiModelProperty(value = "文章类型 1广告文章 2权威解读 必传")
  10 + private int articleType ;
  11 + @ApiModelProperty(value = "标题")
  12 + private String title ;
  13 + @ApiModelProperty(value = "文章栏目")
  14 + private int columnType ;
  15 +
  16 + public int getArticleType() {
  17 + return articleType;
  18 + }
  19 +
  20 + public void setArticleType(int articleType) {
  21 + this.articleType = articleType;
  22 + }
  23 +
  24 + public String getTitle() {
  25 + return title;
  26 + }
  27 +
  28 + public void setTitle(String title) {
  29 + this.title = title;
  30 + }
  31 +
  32 + public int getColumnType() {
  33 + return columnType;
  34 + }
  35 +
  36 + public void setColumnType(int columnType) {
  37 + this.columnType = columnType;
  38 + }
  39 +}
... ...
src/main/java/com/sincere/student/dto/BaseDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/BaseDto.java
... ... @@ -0,0 +1,43 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class BaseDto<T> {
  8 +
  9 + @ApiModelProperty(value = "接口成功与否")
  10 + private boolean success ;
  11 + @ApiModelProperty(value = "错误信息")
  12 + private String message ;
  13 + @ApiModelProperty(value = "数据")
  14 + private T data ;
  15 +
  16 + public boolean isSuccess() {
  17 + return success;
  18 + }
  19 +
  20 + public void setSuccess(boolean success) {
  21 + this.success = success;
  22 + }
  23 +
  24 + public String getMessage() {
  25 + return message;
  26 + }
  27 +
  28 + public void setMessage(String message) {
  29 + this.message = message;
  30 + }
  31 +
  32 + public T getData() {
  33 + return data;
  34 + }
  35 +
  36 + public void setData(T data) {
  37 + this.data = data;
  38 + }
  39 +
  40 + public BaseDto() {
  41 + this.success = true ;
  42 + }
  43 +}
... ...
src/main/java/com/sincere/student/dto/ColumnDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/ColumnDto.java
... ... @@ -0,0 +1,23 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +public class ColumnDto {
  4 +
  5 + private int type ;
  6 + private String name ;
  7 +
  8 + public int getType() {
  9 + return type;
  10 + }
  11 +
  12 + public void setType(int type) {
  13 + this.type = type;
  14 + }
  15 +
  16 + public String getName() {
  17 + return name;
  18 + }
  19 +
  20 + public void setName(String name) {
  21 + this.name = name;
  22 + }
  23 +}
... ...
src/main/java/com/sincere/student/dto/ConsultSearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/ConsultSearchDto.java
... ... @@ -0,0 +1,60 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class ConsultSearchDto extends PageDto {
  8 +
  9 + @ApiModelProperty(value = "栏目类型")
  10 + private int columnType ;
  11 + @ApiModelProperty(value = "查询学校")
  12 + private String universityName ;
  13 + @ApiModelProperty(value = "省")
  14 + private String province ;
  15 + @ApiModelProperty(value = "市")
  16 + private String city ;
  17 + @ApiModelProperty(value = "专业")
  18 + private String majorName ;
  19 +
  20 + public int getColumnType() {
  21 + return columnType;
  22 + }
  23 +
  24 + public void setColumnType(int columnType) {
  25 + this.columnType = columnType;
  26 + }
  27 +
  28 + public String getUniversityName() {
  29 + return universityName;
  30 + }
  31 +
  32 + public void setUniversityName(String universityName) {
  33 + this.universityName = universityName;
  34 + }
  35 +
  36 + public String getProvince() {
  37 + return province;
  38 + }
  39 +
  40 + public void setProvince(String province) {
  41 + this.province = province;
  42 + }
  43 +
  44 + public String getCity() {
  45 + return city;
  46 + }
  47 +
  48 + public void setCity(String city) {
  49 + this.city = city;
  50 + }
  51 +
  52 + public String getMajorName() {
  53 + return majorName;
  54 + }
  55 +
  56 + public void setMajorName(String majorName) {
  57 + this.majorName = majorName;
  58 + }
  59 +
  60 +}
... ...
src/main/java/com/sincere/student/dto/IdDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/IdDto.java
... ... @@ -0,0 +1,14 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +public class IdDto {
  4 +
  5 + private int id ;
  6 +
  7 + public int getId() {
  8 + return id;
  9 + }
  10 +
  11 + public void setId(int id) {
  12 + this.id = id;
  13 + }
  14 +}
... ...
src/main/java/com/sincere/student/dto/LinkUsDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/LinkUsDto.java
... ... @@ -0,0 +1,14 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +public class LinkUsDto {
  4 +
  5 + private String url ;
  6 +
  7 + public String getUrl() {
  8 + return url;
  9 + }
  10 +
  11 + public void setUrl(String url) {
  12 + this.url = url;
  13 + }
  14 +}
... ...
src/main/java/com/sincere/student/dto/MajorSearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/MajorSearchDto.java
... ... @@ -0,0 +1,29 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class MajorSearchDto extends PageDto {
  8 +
  9 + @ApiModelProperty(value = "查询名称,或编码")
  10 + private String search ;
  11 + @ApiModelProperty(value = "父级专业id 查一级专业时,pid传-1")
  12 + private int pid ;
  13 +
  14 + public int getPid() {
  15 + return pid;
  16 + }
  17 +
  18 + public void setPid(int pid) {
  19 + this.pid = pid;
  20 + }
  21 +
  22 + public String getSearch() {
  23 + return search;
  24 + }
  25 +
  26 + public void setSearch(String search) {
  27 + this.search = search;
  28 + }
  29 +}
... ...
src/main/java/com/sincere/student/dto/MessageSearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/MessageSearchDto.java
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class MessageSearchDto extends PageDto {
  8 +
  9 + @ApiModelProperty(value = "搜索")
  10 + private String search ;
  11 +
  12 + public String getSearch() {
  13 + return search;
  14 + }
  15 +
  16 + public void setSearch(String search) {
  17 + this.search = search;
  18 + }
  19 +}
... ...
src/main/java/com/sincere/student/dto/PageDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/PageDto.java
... ... @@ -0,0 +1,28 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class PageDto {
  8 + @ApiModelProperty(value = "页码")
  9 + private int page ;
  10 + @ApiModelProperty(value = "每页数量")
  11 + private int pageSize ;
  12 +
  13 + public int getPage() {
  14 + return page;
  15 + }
  16 +
  17 + public void setPage(int page) {
  18 + this.page = page;
  19 + }
  20 +
  21 + public int getPageSize() {
  22 + return pageSize;
  23 + }
  24 +
  25 + public void setPageSize(int pageSize) {
  26 + this.pageSize = pageSize;
  27 + }
  28 +}
... ...
src/main/java/com/sincere/student/dto/PointSearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/PointSearchDto.java
... ... @@ -0,0 +1,79 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class PointSearchDto extends PageDto {
  8 +
  9 + @ApiModelProperty(value = "投档线主键")
  10 + private int submitId ;
  11 + @ApiModelProperty(value = "查询学校")
  12 + private String universityName ;
  13 + @ApiModelProperty(value = "省")
  14 + private String province ;
  15 + @ApiModelProperty(value = "市")
  16 + private String city ;
  17 + @ApiModelProperty(value = "专业")
  18 + private String majorName ;
  19 + @ApiModelProperty(value = "分数")
  20 + private int point ;
  21 + @ApiModelProperty(value = "位次")
  22 + private int rank ;
  23 +
  24 + public String getUniversityName() {
  25 + return universityName;
  26 + }
  27 +
  28 + public void setUniversityName(String universityName) {
  29 + this.universityName = universityName;
  30 + }
  31 +
  32 + public String getProvince() {
  33 + return province;
  34 + }
  35 +
  36 + public void setProvince(String province) {
  37 + this.province = province;
  38 + }
  39 +
  40 + public String getCity() {
  41 + return city;
  42 + }
  43 +
  44 + public void setCity(String city) {
  45 + this.city = city;
  46 + }
  47 +
  48 + public String getMajorName() {
  49 + return majorName;
  50 + }
  51 +
  52 + public void setMajorName(String majorName) {
  53 + this.majorName = majorName;
  54 + }
  55 +
  56 + public int getPoint() {
  57 + return point;
  58 + }
  59 +
  60 + public void setPoint(int point) {
  61 + this.point = point;
  62 + }
  63 +
  64 + public int getRank() {
  65 + return rank;
  66 + }
  67 +
  68 + public void setRank(int rank) {
  69 + this.rank = rank;
  70 + }
  71 +
  72 + public int getSubmitId() {
  73 + return submitId;
  74 + }
  75 +
  76 + public void setSubmitId(int submitId) {
  77 + this.submitId = submitId;
  78 + }
  79 +}
... ...
src/main/java/com/sincere/student/dto/UniversitySearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/UniversitySearchDto.java
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class UniversitySearchDto extends PageDto {
  8 +
  9 + @ApiModelProperty(value = "查询名称")
  10 + private String search ;
  11 +
  12 + public String getSearch() {
  13 + return search;
  14 + }
  15 +
  16 + public void setSearch(String search) {
  17 + this.search = search;
  18 + }
  19 +}
... ...
src/main/java/com/sincere/student/dto/VideoSearchDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/VideoSearchDto.java
... ... @@ -0,0 +1,30 @@
  1 +package com.sincere.student.dto;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class VideoSearchDto extends PageDto {
  8 +
  9 + @ApiModelProperty(value = "视频栏目主键")
  10 + private int columnTypeId ;
  11 +
  12 + @ApiModelProperty(value = "查询名称")
  13 + private String universityName ;
  14 +
  15 + public int getColumnTypeId() {
  16 + return columnTypeId;
  17 + }
  18 +
  19 + public void setColumnTypeId(int columnTypeId) {
  20 + this.columnTypeId = columnTypeId;
  21 + }
  22 +
  23 + public String getUniversityName() {
  24 + return universityName;
  25 + }
  26 +
  27 + public void setUniversityName(String universityName) {
  28 + this.universityName = universityName;
  29 + }
  30 +}
... ...
src/main/java/com/sincere/student/dto/app/AppConsult.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/app/AppConsult.java
... ... @@ -0,0 +1,45 @@
  1 +package com.sincere.student.dto.app;
  2 +
  3 +import com.sincere.student.model.Consult;
  4 +import com.sincere.student.utils.Page;
  5 +import io.swagger.annotations.ApiModel;
  6 +import io.swagger.annotations.ApiModelProperty;
  7 +
  8 +import java.util.List;
  9 +
  10 +@ApiModel
  11 +public class AppConsult {
  12 +
  13 + @ApiModelProperty(value = "招生咨询栏目主键")
  14 + private int columnTypeId ;
  15 + @ApiModelProperty(value = "招生咨询栏目名称")
  16 + private String name ;
  17 + @ApiModelProperty(value = "具体招生咨询 信息")
  18 + private List<Consult> list ;
  19 +
  20 + public int getColumnTypeId() {
  21 + return columnTypeId;
  22 + }
  23 +
  24 + public void setColumnTypeId(int columnTypeId) {
  25 + this.columnTypeId = columnTypeId;
  26 + }
  27 +
  28 + public String getName() {
  29 + return name;
  30 + }
  31 +
  32 + public void setName(String name) {
  33 + this.name = name;
  34 + }
  35 +
  36 + public List<Consult> getList() {
  37 + return list;
  38 + }
  39 +
  40 + public void setList(List<Consult> list) {
  41 + this.list = list;
  42 + }
  43 +
  44 +
  45 +}
... ...
src/main/java/com/sincere/student/dto/app/ConsultPageDto.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/app/ConsultPageDto.java
... ... @@ -0,0 +1,20 @@
  1 +package com.sincere.student.dto.app;
  2 +
  3 +import com.sincere.student.dto.PageDto;
  4 +import io.swagger.annotations.ApiModel;
  5 +import io.swagger.annotations.ApiModelProperty;
  6 +
  7 +@ApiModel
  8 +public class ConsultPageDto extends PageDto {
  9 +
  10 + @ApiModelProperty(value = "招生咨询栏目主键")
  11 + private int columnTypeId ;
  12 +
  13 + public int getColumnTypeId() {
  14 + return columnTypeId;
  15 + }
  16 +
  17 + public void setColumnTypeId(int columnTypeId) {
  18 + this.columnTypeId = columnTypeId;
  19 + }
  20 +}
... ...
src/main/java/com/sincere/student/dto/submit/SubmitLine.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/submit/SubmitLine.java
... ... @@ -0,0 +1,41 @@
  1 +package com.sincere.student.dto.submit;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.List;
  7 +
  8 +@ApiModel
  9 +public class SubmitLine {
  10 +
  11 + @ApiModelProperty(value = "主键")
  12 + private int id ;
  13 + @ApiModelProperty(value = "标题")
  14 + private String title ;
  15 + @ApiModelProperty(value = "学校列表")
  16 + private List<SubmitUniv> universityList ;
  17 +
  18 + public int getId() {
  19 + return id;
  20 + }
  21 +
  22 + public void setId(int id) {
  23 + this.id = id;
  24 + }
  25 +
  26 + public String getTitle() {
  27 + return title;
  28 + }
  29 +
  30 + public void setTitle(String title) {
  31 + this.title = title;
  32 + }
  33 +
  34 + public List<SubmitUniv> getUniversityList() {
  35 + return universityList;
  36 + }
  37 +
  38 + public void setUniversityList(List<SubmitUniv> universityList) {
  39 + this.universityList = universityList;
  40 + }
  41 +}
... ...
src/main/java/com/sincere/student/dto/submit/SubmitMajor.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/submit/SubmitMajor.java
... ... @@ -0,0 +1,49 @@
  1 +package com.sincere.student.dto.submit;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class SubmitMajor {
  8 +
  9 + @ApiModelProperty(value = "专业")
  10 + private String major ;
  11 + @ApiModelProperty(value = "分数")
  12 + private int grade ;
  13 + @ApiModelProperty(value = "招收数量")
  14 + private int enrollNumber ;
  15 + @ApiModelProperty(value = "位次号")
  16 + private int rank ;
  17 +
  18 + public String getMajor() {
  19 + return major;
  20 + }
  21 +
  22 + public void setMajor(String major) {
  23 + this.major = major;
  24 + }
  25 +
  26 + public int getGrade() {
  27 + return grade;
  28 + }
  29 +
  30 + public void setGrade(int grade) {
  31 + this.grade = grade;
  32 + }
  33 +
  34 + public int getEnrollNumber() {
  35 + return enrollNumber;
  36 + }
  37 +
  38 + public void setEnrollNumber(int enrollNumber) {
  39 + this.enrollNumber = enrollNumber;
  40 + }
  41 +
  42 + public int getRank() {
  43 + return rank;
  44 + }
  45 +
  46 + public void setRank(int rank) {
  47 + this.rank = rank;
  48 + }
  49 +}
... ...
src/main/java/com/sincere/student/dto/submit/SubmitUniv.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/dto/submit/SubmitUniv.java
... ... @@ -0,0 +1,41 @@
  1 +package com.sincere.student.dto.submit;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.List;
  7 +
  8 +@ApiModel
  9 +public class SubmitUniv {
  10 +
  11 + @ApiModelProperty(value = "主键")
  12 + private int universityId ;
  13 + @ApiModelProperty(value = "学校名称")
  14 + private String universityName ;
  15 + @ApiModelProperty(value = "专业列表")
  16 + private List<SubmitMajor> majorList ;
  17 +
  18 + public int getUniversityId() {
  19 + return universityId;
  20 + }
  21 +
  22 + public void setUniversityId(int universityId) {
  23 + this.universityId = universityId;
  24 + }
  25 +
  26 + public String getUniversityName() {
  27 + return universityName;
  28 + }
  29 +
  30 + public void setUniversityName(String universityName) {
  31 + this.universityName = universityName;
  32 + }
  33 +
  34 + public List<SubmitMajor> getMajorList() {
  35 + return majorList;
  36 + }
  37 +
  38 + public void setMajorList(List<SubmitMajor> majorList) {
  39 + this.majorList = majorList;
  40 + }
  41 +}
... ...
src/main/java/com/sincere/student/enums/AdvertEnums.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/enums/AdvertEnums.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.enums;
  2 +
  3 +public enum AdvertEnums {
  4 +
  5 + screen(1),
  6 + banner(2);
  7 +
  8 + private int type ;
  9 +
  10 + AdvertEnums(int type) {
  11 + this.type = type;
  12 + }
  13 +
  14 + public int getType() {
  15 + return type;
  16 + }
  17 +
  18 + public void setType(int type) {
  19 + this.type = type;
  20 + }
  21 +}
... ...
src/main/java/com/sincere/student/enums/ArticleEnums.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/enums/ArticleEnums.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.enums;
  2 +
  3 +public enum ArticleEnums {
  4 +
  5 + advert(1),
  6 + article(2);
  7 +
  8 + private int type ;
  9 +
  10 + ArticleEnums(int type) {
  11 + this.type = type;
  12 + }
  13 +
  14 + public int getType() {
  15 + return type;
  16 + }
  17 +
  18 + public void setType(int type) {
  19 + this.type = type;
  20 + }
  21 +}
... ...
src/main/java/com/sincere/student/enums/ColumnEnums.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/enums/ColumnEnums.java
... ... @@ -0,0 +1,41 @@
  1 +package com.sincere.student.enums;
  2 +
  3 +public enum ColumnEnums {
  4 +
  5 + article(1,"权威解读"),
  6 + university(2,"招生"),
  7 + video(3,"视频");
  8 +
  9 + private int type ;
  10 + private String message ;
  11 +
  12 + public int getType() {
  13 + return type;
  14 + }
  15 +
  16 + public void setType(int type) {
  17 + this.type = type;
  18 + }
  19 +
  20 + public String getMessage() {
  21 + return message;
  22 + }
  23 +
  24 + public void setMessage(String message) {
  25 + this.message = message;
  26 + }
  27 +
  28 + ColumnEnums(int type, String message) {
  29 + this.type = type;
  30 + this.message = message;
  31 + }
  32 +
  33 + public static ColumnEnums getByType(int type){
  34 + for(ColumnEnums columnEnums : ColumnEnums.values()){
  35 + if(columnEnums.getType() == type){
  36 + return columnEnums ;
  37 + }
  38 + }
  39 + return null ;
  40 + }
  41 +}
... ...
src/main/java/com/sincere/student/enums/ParameterUtils.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/enums/ParameterUtils.java
... ... @@ -0,0 +1,6 @@
  1 +package com.sincere.student.enums;
  2 +
  3 +public class ParameterUtils {
  4 +
  5 + public static String link_us = "link_us" ;
  6 +}
... ...
src/main/java/com/sincere/student/filter/AllowOriginFilter.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/filter/AllowOriginFilter.java
... ... @@ -0,0 +1,35 @@
  1 +package com.sincere.student.filter;
  2 +
  3 +import org.springframework.stereotype.Component;
  4 +
  5 +import javax.servlet.*;
  6 +import javax.servlet.annotation.WebFilter;
  7 +import javax.servlet.http.HttpServletResponse;
  8 +import java.io.IOException;
  9 +/**
  10 + * 用于解决跨域问题
  11 + * @author chen
  12 + * @version 1.0
  13 + * @date 2019/10/11 0011 10:17
  14 + */
  15 +@Component
  16 +@WebFilter(urlPatterns = "/*", filterName = "authFilter")
  17 +public class AllowOriginFilter implements Filter {
  18 +
  19 + @Override
  20 + public void init(FilterConfig filterConfig) throws ServletException {
  21 + }
  22 +
  23 + public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  24 + HttpServletResponse response = (HttpServletResponse) res;
  25 + response.setHeader("Access-Control-Allow-Origin", "*");
  26 + response.setHeader("Access-Control-Allow-Methods", "*");
  27 + response.setHeader("Access-Control-Allow-Credentials", "true");
  28 + response.setHeader("Access-Control-Allow-Headers","*");
  29 + chain.doFilter(req, res);
  30 + }
  31 +
  32 + @Override
  33 + public void destroy() {
  34 + }
  35 +}
... ...
src/main/java/com/sincere/student/mapper/AdvertMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/AdvertMapper.java
... ... @@ -0,0 +1,18 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.Advert;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface AdvertMapper {
  8 +
  9 + List<Advert> getList(int type);
  10 +
  11 + Advert getDetail(int id);
  12 +
  13 + int create(Advert advert);
  14 +
  15 + int delete(int id);
  16 +
  17 + int update(Advert advert);
  18 +}
... ...
src/main/java/com/sincere/student/mapper/AreaMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/AreaMapper.java
... ... @@ -0,0 +1,12 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.Area;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface AreaMapper {
  8 +
  9 + List<Area> getProvince();
  10 +
  11 + List<Area> getCity(String code);
  12 +}
... ...
src/main/java/com/sincere/student/mapper/ArticleMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/ArticleMapper.java
... ... @@ -0,0 +1,23 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.ArticleSearchDto;
  4 +import com.sincere.student.model.Article;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface ArticleMapper {
  9 +
  10 + List<Article> getList(ArticleSearchDto articleSearchDto);
  11 +
  12 + int getListCount(ArticleSearchDto articleSearchDto);
  13 +
  14 + List<Article> getRelationList(int universityId);
  15 +
  16 + Article selectById(int id);
  17 +
  18 + int create(Article article);
  19 +
  20 + int delete(int id);
  21 +
  22 + int update(Article article);
  23 +}
... ...
src/main/java/com/sincere/student/mapper/ColumnMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/ColumnMapper.java
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.ColumnDto;
  4 +import com.sincere.student.model.ColumnType;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface ColumnMapper {
  9 +
  10 + List<ColumnType> getList(ColumnDto columnDto);
  11 +
  12 + ColumnType selectDetail(int id);
  13 +
  14 + int create(ColumnType columnType);
  15 +
  16 + int update(ColumnType columnType);
  17 +
  18 + int delete(int id);
  19 +}
... ...
src/main/java/com/sincere/student/mapper/MajorMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/MajorMapper.java
... ... @@ -0,0 +1,18 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.Major;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface MajorMapper {
  8 +
  9 + List<Major> getList(Major major);
  10 +
  11 + int getListCount(Major major);
  12 +
  13 + int create(Major major);
  14 +
  15 + int update(Major major);
  16 +
  17 + int delete(int id);
  18 +}
... ...
src/main/java/com/sincere/student/mapper/ParameterMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/ParameterMapper.java
... ... @@ -0,0 +1,14 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.Parameter;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface ParameterMapper {
  8 +
  9 + List<Parameter> getByCode(String code);
  10 +
  11 + int create(Parameter parameter);
  12 +
  13 + int update(Parameter parameter);
  14 +}
... ...
src/main/java/com/sincere/student/mapper/SysUserMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/SysUserMapper.java
... ... @@ -0,0 +1,17 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.SysUser;
  4 +
  5 +public interface SysUserMapper {
  6 + int deleteByPrimaryKey(Integer id);
  7 +
  8 + int insert(SysUser record);
  9 +
  10 + int insertSelective(SysUser record);
  11 +
  12 + SysUser selectByPrimaryKey(Integer id);
  13 +
  14 + int updateByPrimaryKeySelective(SysUser record);
  15 +
  16 + int updateByPrimaryKey(SysUser record);
  17 +}
0 18 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/UniversityConsultDetailMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityConsultDetailMapper.java
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.UniversityConsultDetail;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface UniversityConsultDetailMapper {
  8 + int deleteByPrimaryKey(Integer id);
  9 +
  10 + int insert(UniversityConsultDetail record);
  11 +
  12 + int insertSelective(UniversityConsultDetail record);
  13 +
  14 + List<UniversityConsultDetail> selectByConsult(Integer id);
  15 +
  16 + int updateByPrimaryKeySelective(UniversityConsultDetail record);
  17 +
  18 + int updateByPrimaryKey(UniversityConsultDetail record);
  19 +}
0 20 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/UniversityConsultMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityConsultMapper.java
... ... @@ -0,0 +1,27 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.ConsultSearchDto;
  4 +import com.sincere.student.model.Consult;
  5 +import com.sincere.student.model.UniversityConsult;
  6 +
  7 +import java.util.List;
  8 +
  9 +public interface UniversityConsultMapper {
  10 +
  11 + int getListCount(ConsultSearchDto consultSearchDto);
  12 +
  13 + List<Consult> getList(ConsultSearchDto consultSearchDto);
  14 +
  15 + int getColumnListCount(int columnType);
  16 +
  17 + List<Consult> getColumnList(int columnType);
  18 +
  19 + int deleteByPrimaryKey(Integer id);
  20 +
  21 + int insert(UniversityConsult record);
  22 +
  23 + Consult selectByPrimaryKey(Integer id);
  24 +
  25 + int updateByPrimaryKeySelective(UniversityConsult record);
  26 +
  27 +}
0 28 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/UniversityMajorMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityMajorMapper.java
... ... @@ -0,0 +1,17 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.UniversityMajor;
  4 +
  5 +import java.util.List;
  6 +import java.util.Map;
  7 +
  8 +public interface UniversityMajorMapper {
  9 +
  10 + int insertBatch(List<UniversityMajor> list);
  11 +
  12 + int deleteByUniversityId(int universityId);
  13 +
  14 + List<String> selectUniversityMajor(int universityId);
  15 +
  16 + Integer selectIdByMajor(Map<String,String> map);
  17 +}
... ...
src/main/java/com/sincere/student/mapper/UniversityMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityMapper.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.UniversitySearchDto;
  4 +import com.sincere.student.model.University;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface UniversityMapper {
  9 +
  10 + int getListCount(UniversitySearchDto universitySearchDto);
  11 +
  12 + List<University> getList(UniversitySearchDto universitySearchDto);
  13 +
  14 + int create(University university);
  15 +
  16 + int delete(int id);
  17 +
  18 + int update(University university);
  19 +
  20 + Integer selectByName(String name);
  21 +}
... ...
src/main/java/com/sincere/student/mapper/UniversityMessageMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityMessageMapper.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.MessageSearchDto;
  4 +import com.sincere.student.model.Message;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface UniversityMessageMapper {
  9 +
  10 + int getListCount(MessageSearchDto messageSearchDto);
  11 +
  12 + int deleteByPrimaryKey(int id);
  13 +
  14 + List<Message> getList(MessageSearchDto messageSearchDto);
  15 +
  16 + Message getDetail(int id);
  17 +
  18 + int insert(Message record);
  19 +
  20 + int insertSelective(Message record);
  21 +}
0 22 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/UniversityPointMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityPointMapper.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.Point;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface UniversityPointMapper {
  8 + int deleteBySubmit(Integer id);
  9 +
  10 + int insert(Point record);
  11 +
  12 + int insertBatch(List<Point> list);
  13 +
  14 + int insertSelective(Point record);
  15 +
  16 + Point selectByPrimaryKey(Integer id);
  17 +
  18 + int updateByPrimaryKeySelective(Point record);
  19 +
  20 + int updateByPrimaryKey(Point record);
  21 +}
0 22 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/UniversityReplyMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversityReplyMapper.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.model.Reply;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface UniversityReplyMapper {
  8 + int deleteByPrimaryKey(Integer id);
  9 +
  10 + int insert(Reply record);
  11 +
  12 + int insertSelective(Reply record);
  13 +
  14 + List<Reply> selectByMessageId(Integer id);
  15 +
  16 + int updateByPrimaryKeySelective(Reply record);
  17 +
  18 + int updateByPrimaryKey(Reply record);
  19 +
  20 + int deleteByMessageId(int messageId);
  21 +}
0 22 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/UniversitySubmitFileMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/UniversitySubmitFileMapper.java
... ... @@ -0,0 +1,30 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.MessageSearchDto;
  4 +import com.sincere.student.dto.PointSearchDto;
  5 +import com.sincere.student.dto.submit.SubmitLine;
  6 +import com.sincere.student.model.SubmitFile;
  7 +
  8 +import java.util.List;
  9 +
  10 +public interface UniversitySubmitFileMapper {
  11 + int deleteByPrimaryKey(Integer id);
  12 +
  13 + int insert(SubmitFile record);
  14 +
  15 + int insertSelective(SubmitFile record);
  16 +
  17 + SubmitFile selectByPrimaryKey(Integer id);
  18 +
  19 + int updateByPrimaryKeySelective(SubmitFile record);
  20 +
  21 + int updateByPrimaryKey(SubmitFile record);
  22 +
  23 + int getListCount(MessageSearchDto dto);
  24 +
  25 + List<SubmitFile> getList(MessageSearchDto dto);
  26 +
  27 + List<SubmitLine> getAppList(PointSearchDto pointSearchDto);
  28 +
  29 + int getAppListCount(PointSearchDto pointSearchDto);
  30 +}
0 31 \ No newline at end of file
... ...
src/main/java/com/sincere/student/mapper/VideoMapper.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/mapper/VideoMapper.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.mapper;
  2 +
  3 +import com.sincere.student.dto.VideoSearchDto;
  4 +import com.sincere.student.model.Video;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface VideoMapper {
  9 +
  10 + int getListCount(VideoSearchDto dto);
  11 +
  12 + List<Video> getList(VideoSearchDto dto);
  13 +
  14 + int create(Video video);
  15 +
  16 + int update(Video video);
  17 +
  18 + int delete(int id);
  19 +
  20 + Video getById(int id);
  21 +}
... ...
src/main/java/com/sincere/student/model/Advert.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Advert.java
... ... @@ -0,0 +1,91 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +
  8 +@ApiModel
  9 +public class Advert {
  10 +
  11 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  12 + private int id ;
  13 + @ApiModelProperty(value = "广告类型 1:开屏 2:banner 所有接口不用传")
  14 + private int type ;
  15 + @ApiModelProperty(value = "图片地址")
  16 + private String imgUrl ;
  17 + @ApiModelProperty(value = "外链")
  18 + private String urlLink ;
  19 + @ApiModelProperty(value = "排序")
  20 + private int sort ;
  21 + @ApiModelProperty(value = "状态 预留字段 所有接口不用传")
  22 + private int status ;
  23 + @ApiModelProperty(value = "创建时间 所有接口不用传")
  24 + private Date createTime ;
  25 + @ApiModelProperty(value = "标题")
  26 + private String title ;
  27 +
  28 + public int getId() {
  29 + return id;
  30 + }
  31 +
  32 + public void setId(int id) {
  33 + this.id = id;
  34 + }
  35 +
  36 + public int getType() {
  37 + return type;
  38 + }
  39 +
  40 + public void setType(int type) {
  41 + this.type = type;
  42 + }
  43 +
  44 + public String getImgUrl() {
  45 + return imgUrl;
  46 + }
  47 +
  48 + public void setImgUrl(String imgUrl) {
  49 + this.imgUrl = imgUrl;
  50 + }
  51 +
  52 + public String getUrlLink() {
  53 + return urlLink;
  54 + }
  55 +
  56 + public void setUrlLink(String urlLink) {
  57 + this.urlLink = urlLink;
  58 + }
  59 +
  60 + public int getSort() {
  61 + return sort;
  62 + }
  63 +
  64 + public void setSort(int sort) {
  65 + this.sort = sort;
  66 + }
  67 +
  68 + public int getStatus() {
  69 + return status;
  70 + }
  71 +
  72 + public void setStatus(int status) {
  73 + this.status = status;
  74 + }
  75 +
  76 + public Date getCreateTime() {
  77 + return createTime;
  78 + }
  79 +
  80 + public void setCreateTime(Date createTime) {
  81 + this.createTime = createTime;
  82 + }
  83 +
  84 + public String getTitle() {
  85 + return title;
  86 + }
  87 +
  88 + public void setTitle(String title) {
  89 + this.title = title;
  90 + }
  91 +}
... ...
src/main/java/com/sincere/student/model/Area.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Area.java
... ... @@ -0,0 +1,23 @@
  1 +package com.sincere.student.model;
  2 +
  3 +public class Area {
  4 +
  5 + private String code ;
  6 + private String name ;
  7 +
  8 + public String getCode() {
  9 + return code;
  10 + }
  11 +
  12 + public void setCode(String code) {
  13 + this.code = code;
  14 + }
  15 +
  16 + public String getName() {
  17 + return name;
  18 + }
  19 +
  20 + public void setName(String name) {
  21 + this.name = name;
  22 + }
  23 +}
... ...
src/main/java/com/sincere/student/model/Article.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Article.java
... ... @@ -0,0 +1,151 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +
  8 +@ApiModel
  9 +public class Article {
  10 +
  11 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  12 + private int id ;
  13 + @ApiModelProperty(value = "标题")
  14 + private String title ;
  15 + @ApiModelProperty(value = "栏目 type=1 不用传")
  16 + private int columnType ;
  17 + @ApiModelProperty(value = "大学id")
  18 + private int universityId ;
  19 + @ApiModelProperty(value = "排序")
  20 + private int sort ;
  21 + @ApiModelProperty(value = "内容")
  22 + private String context ;
  23 + @ApiModelProperty(value = "作者")
  24 + private String author ;
  25 + @ApiModelProperty(value = "封面图片")
  26 + private String imageUrl ;
  27 + @ApiModelProperty(value = "视频链接")
  28 + private String videoUrl ;
  29 + @ApiModelProperty(value = "外链")
  30 + private String articleLink ;
  31 + @ApiModelProperty(value = "点赞数 不用传")
  32 + private int goodNumber ;
  33 + @ApiModelProperty(value = "浏览量 不用传")
  34 + private int lookNumber ;
  35 + @ApiModelProperty(value = "创建时间 不用传")
  36 + private Date createTime ;
  37 + @ApiModelProperty(value = "文章类型 1广告文章 2权威解读 ")
  38 + private int type ;
  39 +
  40 + public int getType() {
  41 + return type;
  42 + }
  43 +
  44 + public void setType(int type) {
  45 + this.type = type;
  46 + }
  47 +
  48 + public int getId() {
  49 + return id;
  50 + }
  51 +
  52 + public void setId(int id) {
  53 + this.id = id;
  54 + }
  55 +
  56 + public String getTitle() {
  57 + return title;
  58 + }
  59 +
  60 + public void setTitle(String title) {
  61 + this.title = title;
  62 + }
  63 +
  64 + public int getColumnType() {
  65 + return columnType;
  66 + }
  67 +
  68 + public void setColumnType(int columnType) {
  69 + this.columnType = columnType;
  70 + }
  71 +
  72 + public int getUniversityId() {
  73 + return universityId;
  74 + }
  75 +
  76 + public void setUniversityId(int universityId) {
  77 + this.universityId = universityId;
  78 + }
  79 +
  80 + public int getSort() {
  81 + return sort;
  82 + }
  83 +
  84 + public void setSort(int sort) {
  85 + this.sort = sort;
  86 + }
  87 +
  88 + public String getContext() {
  89 + return context;
  90 + }
  91 +
  92 + public void setContext(String context) {
  93 + this.context = context;
  94 + }
  95 +
  96 + public String getAuthor() {
  97 + return author;
  98 + }
  99 +
  100 + public void setAuthor(String author) {
  101 + this.author = author;
  102 + }
  103 +
  104 + public String getImageUrl() {
  105 + return imageUrl;
  106 + }
  107 +
  108 + public void setImageUrl(String imageUrl) {
  109 + this.imageUrl = imageUrl;
  110 + }
  111 +
  112 + public String getVideoUrl() {
  113 + return videoUrl;
  114 + }
  115 +
  116 + public void setVideoUrl(String videoUrl) {
  117 + this.videoUrl = videoUrl;
  118 + }
  119 +
  120 + public String getArticleLink() {
  121 + return articleLink;
  122 + }
  123 +
  124 + public void setArticleLink(String articleLink) {
  125 + this.articleLink = articleLink;
  126 + }
  127 +
  128 + public int getGoodNumber() {
  129 + return goodNumber;
  130 + }
  131 +
  132 + public void setGoodNumber(int goodNumber) {
  133 + this.goodNumber = goodNumber;
  134 + }
  135 +
  136 + public int getLookNumber() {
  137 + return lookNumber;
  138 + }
  139 +
  140 + public void setLookNumber(int lookNumber) {
  141 + this.lookNumber = lookNumber;
  142 + }
  143 +
  144 + public Date getCreateTime() {
  145 + return createTime;
  146 + }
  147 +
  148 + public void setCreateTime(Date createTime) {
  149 + this.createTime = createTime;
  150 + }
  151 +}
... ...
src/main/java/com/sincere/student/model/ColumnType.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/ColumnType.java
... ... @@ -0,0 +1,71 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +
  8 +@ApiModel
  9 +public class ColumnType {
  10 +
  11 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  12 + private int id ;
  13 + @ApiModelProperty(value = "栏目类型(1 文章 2学校 3视频)")
  14 + private int type ;
  15 + @ApiModelProperty(value = "名称")
  16 + private String name ;
  17 + @ApiModelProperty(value = "排序")
  18 + private int sort ;
  19 + @ApiModelProperty(value = "创建时间, 新增,修改接口不用传")
  20 + private Date createTime ;
  21 + @ApiModelProperty(value = "外链,只有type=1传")
  22 + private String urlLink ;
  23 +
  24 + public int getId() {
  25 + return id;
  26 + }
  27 +
  28 + public void setId(int id) {
  29 + this.id = id;
  30 + }
  31 +
  32 + public int getType() {
  33 + return type;
  34 + }
  35 +
  36 + public void setType(int type) {
  37 + this.type = type;
  38 + }
  39 +
  40 + public String getName() {
  41 + return name;
  42 + }
  43 +
  44 + public void setName(String name) {
  45 + this.name = name;
  46 + }
  47 +
  48 + public int getSort() {
  49 + return sort;
  50 + }
  51 +
  52 + public void setSort(int sort) {
  53 + this.sort = sort;
  54 + }
  55 +
  56 + public Date getCreateTime() {
  57 + return createTime;
  58 + }
  59 +
  60 + public void setCreateTime(Date createTime) {
  61 + this.createTime = createTime;
  62 + }
  63 +
  64 + public String getUrlLink() {
  65 + return urlLink;
  66 + }
  67 +
  68 + public void setUrlLink(String urlLink) {
  69 + this.urlLink = urlLink;
  70 + }
  71 +}
... ...
src/main/java/com/sincere/student/model/Consult.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Consult.java
... ... @@ -0,0 +1,122 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +@ApiModel
  10 +public class Consult {
  11 +
  12 + @ApiModelProperty(value = "主键")
  13 + private int id ;
  14 + @ApiModelProperty(value = "学校主键")
  15 + private int universityId ;
  16 + @ApiModelProperty(value = "排序")
  17 + private int sort ;
  18 + @ApiModelProperty(value = "图片地址")
  19 + private String imgUrl ;
  20 + @ApiModelProperty(value = "名称")
  21 + private String name ;
  22 + @ApiModelProperty(value = "编码")
  23 + private String code ;
  24 + @ApiModelProperty(value = "栏目分类")
  25 + private Integer columnType;
  26 + @ApiModelProperty(value = "视频地址")
  27 + private String videoUrl;
  28 + @ApiModelProperty(value = "内容")
  29 + private String context;
  30 + @ApiModelProperty(value = "联系方式")
  31 + private String phone;
  32 + @ApiModelProperty(value = "4个栏目")
  33 + private List<UniversityConsultDetail> list ;
  34 +
  35 + public int getId() {
  36 + return id;
  37 + }
  38 +
  39 + public void setId(int id) {
  40 + this.id = id;
  41 + }
  42 +
  43 + public int getUniversityId() {
  44 + return universityId;
  45 + }
  46 +
  47 + public void setUniversityId(int universityId) {
  48 + this.universityId = universityId;
  49 + }
  50 +
  51 + public int getSort() {
  52 + return sort;
  53 + }
  54 +
  55 + public void setSort(int sort) {
  56 + this.sort = sort;
  57 + }
  58 +
  59 + public String getImgUrl() {
  60 + return imgUrl;
  61 + }
  62 +
  63 + public void setImgUrl(String imgUrl) {
  64 + this.imgUrl = imgUrl;
  65 + }
  66 +
  67 + public String getName() {
  68 + return name;
  69 + }
  70 +
  71 + public void setName(String name) {
  72 + this.name = name;
  73 + }
  74 +
  75 + public String getCode() {
  76 + return code;
  77 + }
  78 +
  79 + public void setCode(String code) {
  80 + this.code = code;
  81 + }
  82 +
  83 + public Integer getColumnType() {
  84 + return columnType;
  85 + }
  86 +
  87 + public void setColumnType(Integer columnType) {
  88 + this.columnType = columnType;
  89 + }
  90 +
  91 + public String getVideoUrl() {
  92 + return videoUrl;
  93 + }
  94 +
  95 + public void setVideoUrl(String videoUrl) {
  96 + this.videoUrl = videoUrl;
  97 + }
  98 +
  99 + public String getContext() {
  100 + return context;
  101 + }
  102 +
  103 + public void setContext(String context) {
  104 + this.context = context;
  105 + }
  106 +
  107 + public List<UniversityConsultDetail> getList() {
  108 + return list;
  109 + }
  110 +
  111 + public void setList(List<UniversityConsultDetail> list) {
  112 + this.list = list;
  113 + }
  114 +
  115 + public String getPhone() {
  116 + return phone;
  117 + }
  118 +
  119 + public void setPhone(String phone) {
  120 + this.phone = phone;
  121 + }
  122 +}
... ...
src/main/java/com/sincere/student/model/Major.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Major.java
... ... @@ -0,0 +1,49 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class Major {
  8 +
  9 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  10 + private int id ;
  11 + @ApiModelProperty(value = "专业名")
  12 + private String major ;
  13 + @ApiModelProperty(value = "专业编码")
  14 + private String majorCode ;
  15 + @ApiModelProperty(value = "父级专业id") //-1 说明是一级专业
  16 + private int pId ;
  17 +
  18 + public int getId() {
  19 + return id;
  20 + }
  21 +
  22 + public void setId(int id) {
  23 + this.id = id;
  24 + }
  25 +
  26 + public String getMajor() {
  27 + return major;
  28 + }
  29 +
  30 + public void setMajor(String major) {
  31 + this.major = major;
  32 + }
  33 +
  34 + public String getMajorCode() {
  35 + return majorCode;
  36 + }
  37 +
  38 + public void setMajorCode(String majorCode) {
  39 + this.majorCode = majorCode;
  40 + }
  41 +
  42 + public int getpId() {
  43 + return pId;
  44 + }
  45 +
  46 + public void setpId(int pId) {
  47 + this.pId = pId;
  48 + }
  49 +}
... ...
src/main/java/com/sincere/student/model/Message.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Message.java
... ... @@ -0,0 +1,72 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +@ApiModel
  10 +public class Message {
  11 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  12 + private Integer id;
  13 + @ApiModelProperty(value = "标题")
  14 + private String title;
  15 + @ApiModelProperty(value = "内容")
  16 + private String context;
  17 + @ApiModelProperty(value = "联系方式")
  18 + private String phone;
  19 + @ApiModelProperty(value = "不用传")
  20 + private Date createTime;
  21 +
  22 +
  23 + private List<Reply> list ;
  24 +
  25 + public List<Reply> getList() {
  26 + return list;
  27 + }
  28 +
  29 + public void setList(List<Reply> list) {
  30 + this.list = list;
  31 + }
  32 +
  33 + public Integer getId() {
  34 + return id;
  35 + }
  36 +
  37 + public void setId(Integer id) {
  38 + this.id = id;
  39 + }
  40 +
  41 + public String getTitle() {
  42 + return title;
  43 + }
  44 +
  45 + public void setTitle(String title) {
  46 + this.title = title;
  47 + }
  48 +
  49 + public String getContext() {
  50 + return context;
  51 + }
  52 +
  53 + public void setContext(String context) {
  54 + this.context = context;
  55 + }
  56 +
  57 + public String getPhone() {
  58 + return phone;
  59 + }
  60 +
  61 + public void setPhone(String phone) {
  62 + this.phone = phone;
  63 + }
  64 +
  65 + public Date getCreateTime() {
  66 + return createTime;
  67 + }
  68 +
  69 + public void setCreateTime(Date createTime) {
  70 + this.createTime = createTime;
  71 + }
  72 +}
0 73 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/Parameter.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Parameter.java
... ... @@ -0,0 +1,23 @@
  1 +package com.sincere.student.model;
  2 +
  3 +public class Parameter {
  4 +
  5 + private String code ;
  6 + private String message ;
  7 +
  8 + public String getCode() {
  9 + return code;
  10 + }
  11 +
  12 + public void setCode(String code) {
  13 + this.code = code;
  14 + }
  15 +
  16 + public String getMessage() {
  17 + return message;
  18 + }
  19 +
  20 + public void setMessage(String message) {
  21 + this.message = message;
  22 + }
  23 +}
... ...
src/main/java/com/sincere/student/model/Point.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Point.java
... ... @@ -0,0 +1,101 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import java.util.Date;
  4 +
  5 +public class Point {
  6 + private Integer id;
  7 +
  8 + private Integer submitId;
  9 + private String universityName;
  10 + private Integer universityId;
  11 + private String major ;
  12 + private Integer majorId;
  13 +
  14 + private Integer grade;
  15 +
  16 + private Integer enrollNumber;
  17 +
  18 + private Integer rank;
  19 +
  20 + private Date createTime;
  21 +
  22 + public String getUniversityName() {
  23 + return universityName;
  24 + }
  25 +
  26 + public void setUniversityName(String universityName) {
  27 + this.universityName = universityName;
  28 + }
  29 +
  30 + public String getMajor() {
  31 + return major;
  32 + }
  33 +
  34 + public void setMajor(String major) {
  35 + this.major = major;
  36 + }
  37 +
  38 + public Integer getId() {
  39 + return id;
  40 + }
  41 +
  42 + public void setId(Integer id) {
  43 + this.id = id;
  44 + }
  45 +
  46 + public Integer getSubmitId() {
  47 + return submitId;
  48 + }
  49 +
  50 + public void setSubmitId(Integer submitId) {
  51 + this.submitId = submitId;
  52 + }
  53 +
  54 + public Integer getUniversityId() {
  55 + return universityId;
  56 + }
  57 +
  58 + public void setUniversityId(Integer universityId) {
  59 + this.universityId = universityId;
  60 + }
  61 +
  62 + public Integer getMajorId() {
  63 + return majorId;
  64 + }
  65 +
  66 + public void setMajorId(Integer majorId) {
  67 + this.majorId = majorId;
  68 + }
  69 +
  70 + public Integer getGrade() {
  71 + return grade;
  72 + }
  73 +
  74 + public void setGrade(Integer grade) {
  75 + this.grade = grade;
  76 + }
  77 +
  78 + public Integer getEnrollNumber() {
  79 + return enrollNumber;
  80 + }
  81 +
  82 + public void setEnrollNumber(Integer enrollNumber) {
  83 + this.enrollNumber = enrollNumber;
  84 + }
  85 +
  86 + public Integer getRank() {
  87 + return rank;
  88 + }
  89 +
  90 + public void setRank(Integer rank) {
  91 + this.rank = rank;
  92 + }
  93 +
  94 + public Date getCreateTime() {
  95 + return createTime;
  96 + }
  97 +
  98 + public void setCreateTime(Date createTime) {
  99 + this.createTime = createTime;
  100 + }
  101 +}
0 102 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/Reply.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Reply.java
... ... @@ -0,0 +1,50 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +
  8 +@ApiModel
  9 +public class Reply {
  10 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  11 + private Integer id;
  12 + @ApiModelProperty(value = "留言主键")
  13 + private Integer messageId;
  14 + @ApiModelProperty(value = "内容")
  15 + private String context;
  16 + @ApiModelProperty(value = "不用传")
  17 + private Date createTime;
  18 +
  19 + public Integer getId() {
  20 + return id;
  21 + }
  22 +
  23 + public void setId(Integer id) {
  24 + this.id = id;
  25 + }
  26 +
  27 + public Integer getMessageId() {
  28 + return messageId;
  29 + }
  30 +
  31 + public void setMessageId(Integer messageId) {
  32 + this.messageId = messageId;
  33 + }
  34 +
  35 + public String getContext() {
  36 + return context;
  37 + }
  38 +
  39 + public void setContext(String context) {
  40 + this.context = context;
  41 + }
  42 +
  43 + public Date getCreateTime() {
  44 + return createTime;
  45 + }
  46 +
  47 + public void setCreateTime(Date createTime) {
  48 + this.createTime = createTime;
  49 + }
  50 +}
0 51 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/SubmitFile.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/SubmitFile.java
... ... @@ -0,0 +1,81 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +@ApiModel
  10 +public class SubmitFile {
  11 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  12 + private Integer id;
  13 + @ApiModelProperty(value = "标题")
  14 + private String title;
  15 + @ApiModelProperty(value = "年")
  16 + private String year;
  17 + @ApiModelProperty(value = "排序")
  18 + private Integer sort;
  19 + @ApiModelProperty(value = "文件路径")
  20 + private String fileUrl ;
  21 + @ApiModelProperty(value = "不用传")
  22 + private Date createTime;
  23 + @ApiModelProperty(value = "不用传")
  24 + private List<Point> list ;
  25 +
  26 + public String getFileUrl() {
  27 + return fileUrl;
  28 + }
  29 +
  30 + public void setFileUrl(String fileUrl) {
  31 + this.fileUrl = fileUrl;
  32 + }
  33 +
  34 + public Integer getId() {
  35 + return id;
  36 + }
  37 +
  38 + public void setId(Integer id) {
  39 + this.id = id;
  40 + }
  41 +
  42 + public String getTitle() {
  43 + return title;
  44 + }
  45 +
  46 + public void setTitle(String title) {
  47 + this.title = title;
  48 + }
  49 +
  50 + public String getYear() {
  51 + return year;
  52 + }
  53 +
  54 + public void setYear(String year) {
  55 + this.year = year;
  56 + }
  57 +
  58 + public Integer getSort() {
  59 + return sort;
  60 + }
  61 +
  62 + public void setSort(Integer sort) {
  63 + this.sort = sort;
  64 + }
  65 +
  66 + public Date getCreateTime() {
  67 + return createTime;
  68 + }
  69 +
  70 + public void setCreateTime(Date createTime) {
  71 + this.createTime = createTime;
  72 + }
  73 +
  74 + public List<Point> getList() {
  75 + return list;
  76 + }
  77 +
  78 + public void setList(List<Point> list) {
  79 + this.list = list;
  80 + }
  81 +}
0 82 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/SysUser.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/SysUser.java
... ... @@ -0,0 +1,48 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +
  8 +@ApiModel
  9 +public class SysUser {
  10 + private Integer id;
  11 + @ApiModelProperty(value = "用户名")
  12 + private String userName;
  13 + @ApiModelProperty(value = "密码")
  14 + private String password;
  15 + private Date createTime;
  16 +
  17 + public Integer getId() {
  18 + return id;
  19 + }
  20 +
  21 + public void setId(Integer id) {
  22 + this.id = id;
  23 + }
  24 +
  25 + public String getUserName() {
  26 + return userName;
  27 + }
  28 +
  29 + public void setUserName(String userName) {
  30 + this.userName = userName;
  31 + }
  32 +
  33 + public String getPassword() {
  34 + return password;
  35 + }
  36 +
  37 + public void setPassword(String password) {
  38 + this.password = password;
  39 + }
  40 +
  41 + public Date getCreateTime() {
  42 + return createTime;
  43 + }
  44 +
  45 + public void setCreateTime(Date createTime) {
  46 + this.createTime = createTime;
  47 + }
  48 +}
0 49 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/University.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/University.java
... ... @@ -0,0 +1,122 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +@ApiModel
  10 +public class University {
  11 +
  12 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  13 + private int id ;
  14 + @ApiModelProperty(value = "学校名称")
  15 + private String name ;
  16 + @ApiModelProperty(value = "学校编码")
  17 + private String code ;
  18 + @ApiModelProperty(value = "高校学科类型")
  19 + private String universityType ;
  20 + @ApiModelProperty(value = "主管部门")
  21 + private String department;
  22 + @ApiModelProperty(value = "所在省")
  23 + private String province ;
  24 + @ApiModelProperty(value = "所在市")
  25 + private String city ;
  26 + @ApiModelProperty(value = "办学层次")
  27 + private String level ;
  28 + @ApiModelProperty(value = "联系方式")
  29 + private String phone ;
  30 + @ApiModelProperty(value = "创建时间")
  31 + private Date createTime ;
  32 + @ApiModelProperty(value = "专业列表,展示用")
  33 + private List<String> majorList ;
  34 +
  35 + public String getPhone() {
  36 + return phone;
  37 + }
  38 +
  39 + public void setPhone(String phone) {
  40 + this.phone = phone;
  41 + }
  42 +
  43 + public int getId() {
  44 + return id;
  45 + }
  46 +
  47 + public void setId(int id) {
  48 + this.id = id;
  49 + }
  50 +
  51 + public String getName() {
  52 + return name;
  53 + }
  54 +
  55 + public void setName(String name) {
  56 + this.name = name;
  57 + }
  58 +
  59 + public String getCode() {
  60 + return code;
  61 + }
  62 +
  63 + public void setCode(String code) {
  64 + this.code = code;
  65 + }
  66 +
  67 + public String getUniversityType() {
  68 + return universityType;
  69 + }
  70 +
  71 + public void setUniversityType(String universityType) {
  72 + this.universityType = universityType;
  73 + }
  74 +
  75 + public String getDepartment() {
  76 + return department;
  77 + }
  78 +
  79 + public void setDepartment(String department) {
  80 + this.department = department;
  81 + }
  82 +
  83 + public String getProvince() {
  84 + return province;
  85 + }
  86 +
  87 + public void setProvince(String province) {
  88 + this.province = province;
  89 + }
  90 +
  91 + public String getCity() {
  92 + return city;
  93 + }
  94 +
  95 + public void setCity(String city) {
  96 + this.city = city;
  97 + }
  98 +
  99 + public String getLevel() {
  100 + return level;
  101 + }
  102 +
  103 + public void setLevel(String level) {
  104 + this.level = level;
  105 + }
  106 +
  107 + public Date getCreateTime() {
  108 + return createTime;
  109 + }
  110 +
  111 + public void setCreateTime(Date createTime) {
  112 + this.createTime = createTime;
  113 + }
  114 +
  115 + public List<String> getMajorList() {
  116 + return majorList;
  117 + }
  118 +
  119 + public void setMajorList(List<String> majorList) {
  120 + this.majorList = majorList;
  121 + }
  122 +}
... ...
src/main/java/com/sincere/student/model/UniversityConsult.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/UniversityConsult.java
... ... @@ -0,0 +1,101 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +@ApiModel
  10 +public class UniversityConsult {
  11 + @ApiModelProperty(value = "主键")
  12 + private Integer id;
  13 + @ApiModelProperty(value = "学校之间")
  14 + private Integer universityId;
  15 + @ApiModelProperty(value = "栏目分类")
  16 + private Integer columnType;
  17 + @ApiModelProperty(value = "视频地址")
  18 + private String videoUrl;
  19 + @ApiModelProperty(value = "内容")
  20 + private String context;
  21 + @ApiModelProperty(value = "图片地址")
  22 + private String imgUrl;
  23 + @ApiModelProperty(value = "时间")
  24 + private Date createTime;
  25 + @ApiModelProperty(value = "排序")
  26 + private Integer sort;
  27 + @ApiModelProperty(value = "4个栏目")
  28 + private List<UniversityConsultDetail> list;
  29 +
  30 + public List<UniversityConsultDetail> getList() {
  31 + return list;
  32 + }
  33 +
  34 + public void setList(List<UniversityConsultDetail> list) {
  35 + this.list = list;
  36 + }
  37 +
  38 + public Integer getId() {
  39 + return id;
  40 + }
  41 +
  42 + public void setId(Integer id) {
  43 + this.id = id;
  44 + }
  45 +
  46 + public Integer getUniversityId() {
  47 + return universityId;
  48 + }
  49 +
  50 + public void setUniversityId(Integer universityId) {
  51 + this.universityId = universityId;
  52 + }
  53 +
  54 + public Integer getColumnType() {
  55 + return columnType;
  56 + }
  57 +
  58 + public void setColumnType(Integer columnType) {
  59 + this.columnType = columnType;
  60 + }
  61 +
  62 + public String getVideoUrl() {
  63 + return videoUrl;
  64 + }
  65 +
  66 + public void setVideoUrl(String videoUrl) {
  67 + this.videoUrl = videoUrl;
  68 + }
  69 +
  70 + public String getContext() {
  71 + return context;
  72 + }
  73 +
  74 + public void setContext(String context) {
  75 + this.context = context;
  76 + }
  77 +
  78 + public String getImgUrl() {
  79 + return imgUrl;
  80 + }
  81 +
  82 + public void setImgUrl(String imgUrl) {
  83 + this.imgUrl = imgUrl;
  84 + }
  85 +
  86 + public Date getCreateTime() {
  87 + return createTime;
  88 + }
  89 +
  90 + public void setCreateTime(Date createTime) {
  91 + this.createTime = createTime;
  92 + }
  93 +
  94 + public Integer getSort() {
  95 + return sort;
  96 + }
  97 +
  98 + public void setSort(Integer sort) {
  99 + this.sort = sort;
  100 + }
  101 +}
0 102 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/UniversityConsultDetail.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/UniversityConsultDetail.java
... ... @@ -0,0 +1,58 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class UniversityConsultDetail {
  8 + @ApiModelProperty(value = "主键")
  9 + private Integer id;
  10 + @ApiModelProperty(value = "招生咨询会主键")
  11 + private Integer consultId;
  12 + @ApiModelProperty(value = "栏目名称")
  13 + private String columnName;
  14 + @ApiModelProperty(value = "栏目链接")
  15 + private String columnUrl;
  16 + @ApiModelProperty(value = "排序")
  17 + private Integer sort;
  18 +
  19 + public Integer getId() {
  20 + return id;
  21 + }
  22 +
  23 + public void setId(Integer id) {
  24 + this.id = id;
  25 + }
  26 +
  27 + public Integer getConsultId() {
  28 + return consultId;
  29 + }
  30 +
  31 + public void setConsultId(Integer consultId) {
  32 + this.consultId = consultId;
  33 + }
  34 +
  35 + public String getColumnName() {
  36 + return columnName;
  37 + }
  38 +
  39 + public void setColumnName(String columnName) {
  40 + this.columnName = columnName;
  41 + }
  42 +
  43 + public String getColumnUrl() {
  44 + return columnUrl;
  45 + }
  46 +
  47 + public void setColumnUrl(String columnUrl) {
  48 + this.columnUrl = columnUrl;
  49 + }
  50 +
  51 + public Integer getSort() {
  52 + return sort;
  53 + }
  54 +
  55 + public void setSort(Integer sort) {
  56 + this.sort = sort;
  57 + }
  58 +}
0 59 \ No newline at end of file
... ...
src/main/java/com/sincere/student/model/UniversityMajor.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/UniversityMajor.java
... ... @@ -0,0 +1,30 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +@ApiModel
  7 +public class UniversityMajor {
  8 +
  9 +
  10 + @ApiModelProperty(value = "高校id")
  11 + private int universityId ;
  12 + @ApiModelProperty(value = "专业id")
  13 + private int majorId ;
  14 +
  15 + public int getUniversityId() {
  16 + return universityId;
  17 + }
  18 +
  19 + public void setUniversityId(int universityId) {
  20 + this.universityId = universityId;
  21 + }
  22 +
  23 + public int getMajorId() {
  24 + return majorId;
  25 + }
  26 +
  27 + public void setMajorId(int majorId) {
  28 + this.majorId = majorId;
  29 + }
  30 +}
... ...
src/main/java/com/sincere/student/model/Video.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/model/Video.java
... ... @@ -0,0 +1,91 @@
  1 +package com.sincere.student.model;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.Date;
  7 +
  8 +@ApiModel
  9 +public class Video {
  10 +
  11 + @ApiModelProperty(value = "主键 , 新增接口不用传")
  12 + private int id ;
  13 + @ApiModelProperty(value = "学校")
  14 + private int universityId ;
  15 + @ApiModelProperty(value = "栏目")
  16 + private int columnType ;
  17 + @ApiModelProperty(value = "视频路径")
  18 + private String videoUrl ;
  19 + @ApiModelProperty(value = "排序")
  20 + private int sort ;
  21 + @ApiModelProperty(value = "创建时间")
  22 + private Date createTime ;
  23 + @ApiModelProperty(value = "学校名称 展示用")
  24 + private String universityName;
  25 + @ApiModelProperty(value = "学校编码 展示用")
  26 + private String universityCode;
  27 +
  28 + public String getUniversityCode() {
  29 + return universityCode;
  30 + }
  31 +
  32 + public void setUniversityCode(String universityCode) {
  33 + this.universityCode = universityCode;
  34 + }
  35 +
  36 + public String getUniversityName() {
  37 + return universityName;
  38 + }
  39 +
  40 + public void setUniversityName(String universityName) {
  41 + this.universityName = universityName;
  42 + }
  43 +
  44 + public int getId() {
  45 + return id;
  46 + }
  47 +
  48 + public void setId(int id) {
  49 + this.id = id;
  50 + }
  51 +
  52 + public int getUniversityId() {
  53 + return universityId;
  54 + }
  55 +
  56 + public void setUniversityId(int universityId) {
  57 + this.universityId = universityId;
  58 + }
  59 +
  60 + public int getColumnType() {
  61 + return columnType;
  62 + }
  63 +
  64 + public void setColumnType(int columnType) {
  65 + this.columnType = columnType;
  66 + }
  67 +
  68 + public String getVideoUrl() {
  69 + return videoUrl;
  70 + }
  71 +
  72 + public void setVideoUrl(String videoUrl) {
  73 + this.videoUrl = videoUrl;
  74 + }
  75 +
  76 + public int getSort() {
  77 + return sort;
  78 + }
  79 +
  80 + public void setSort(int sort) {
  81 + this.sort = sort;
  82 + }
  83 +
  84 + public Date getCreateTime() {
  85 + return createTime;
  86 + }
  87 +
  88 + public void setCreateTime(Date createTime) {
  89 + this.createTime = createTime;
  90 + }
  91 +}
... ...
src/main/java/com/sincere/student/service/AdvertService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/AdvertService.java
... ... @@ -0,0 +1,20 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.model.Advert;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface AdvertService {
  8 +
  9 + Advert getScreen();
  10 +
  11 + List<Advert> getBanner();
  12 +
  13 + Advert getDetail(int id);
  14 +
  15 + int create(Advert advert);
  16 +
  17 + int delete(int id);
  18 +
  19 + int update(Advert advert);
  20 +}
... ...
src/main/java/com/sincere/student/service/ArticleService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/ArticleService.java
... ... @@ -0,0 +1,23 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.ArticleSearchDto;
  4 +import com.sincere.student.model.Article;
  5 +import com.sincere.student.utils.Page;
  6 +
  7 +import java.util.List;
  8 +
  9 +
  10 +public interface ArticleService {
  11 +
  12 + Page<Article> getList(ArticleSearchDto articleSearchDto);
  13 +
  14 + List<Article> getRelationList(int universityId);
  15 +
  16 + Article selectById(int id);
  17 +
  18 + int create(Article article);
  19 +
  20 + int delete(int id);
  21 +
  22 + int update(Article article);
  23 +}
... ...
src/main/java/com/sincere/student/service/ColumnService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/ColumnService.java
... ... @@ -0,0 +1,19 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.ColumnDto;
  4 +import com.sincere.student.model.ColumnType;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface ColumnService {
  9 +
  10 + List<ColumnType> getList(ColumnDto columnDto);
  11 +
  12 + ColumnType selectDetail(int id);
  13 +
  14 + int create(ColumnType columnType);
  15 +
  16 + int update(ColumnType columnType);
  17 +
  18 + int delete(int id) ;
  19 +}
... ...
src/main/java/com/sincere/student/service/CommonService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/CommonService.java
... ... @@ -0,0 +1,12 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.model.Area;
  4 +
  5 +import java.util.List;
  6 +
  7 +public interface CommonService {
  8 +
  9 + List<Area> getProvince();
  10 +
  11 + List<Area> getCity(String code);
  12 +}
... ...
src/main/java/com/sincere/student/service/ConsultService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/ConsultService.java
... ... @@ -0,0 +1,23 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.ConsultSearchDto;
  4 +import com.sincere.student.model.Consult;
  5 +import com.sincere.student.model.UniversityConsult;
  6 +import com.sincere.student.utils.Page;
  7 +
  8 +
  9 +public interface ConsultService {
  10 +
  11 + Page<Consult> getList(ConsultSearchDto consultSearchDto);
  12 +
  13 + Page<Consult> getColumnList(int columnType ,int page ,int pageSize);
  14 +
  15 + Consult getDetail(int id);
  16 +
  17 + int create(UniversityConsult consult);
  18 +
  19 + int update(UniversityConsult consult);
  20 +
  21 + int delete(int id);
  22 +
  23 +}
... ...
src/main/java/com/sincere/student/service/MajorService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/MajorService.java
... ... @@ -0,0 +1,16 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.MajorSearchDto;
  4 +import com.sincere.student.model.Major;
  5 +import com.sincere.student.utils.Page;
  6 +
  7 +public interface MajorService {
  8 +
  9 + Page<Major> getList(MajorSearchDto majorSearchDto);
  10 +
  11 + int create(Major major);
  12 +
  13 + int update(Major major);
  14 +
  15 + int delete(int id);
  16 +}
... ...
src/main/java/com/sincere/student/service/MessageService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/MessageService.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.MessageSearchDto;
  4 +import com.sincere.student.model.Message;
  5 +import com.sincere.student.model.Reply;
  6 +import com.sincere.student.utils.Page;
  7 +
  8 +public interface MessageService {
  9 +
  10 + Page<Message> getList(MessageSearchDto messageSearchDto);
  11 +
  12 + int deleteMessage(int id);
  13 +
  14 + int reply(Reply reply);
  15 +
  16 + int deleteReply(int id);
  17 +
  18 + Message getDetail(int id);
  19 +
  20 + int create(Message message);
  21 +}
... ...
src/main/java/com/sincere/student/service/ParameterService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/ParameterService.java
... ... @@ -0,0 +1,12 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.model.Parameter;
  4 +
  5 +public interface ParameterService {
  6 +
  7 + Parameter getByCode(String code);
  8 +
  9 + int create(Parameter parameter);
  10 +
  11 + int update(Parameter parameter);
  12 +}
... ...
src/main/java/com/sincere/student/service/SubmitService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/SubmitService.java
... ... @@ -0,0 +1,21 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.MessageSearchDto;
  4 +import com.sincere.student.dto.PointSearchDto;
  5 +import com.sincere.student.dto.submit.SubmitLine;
  6 +import com.sincere.student.model.SubmitFile;
  7 +import com.sincere.student.utils.Page;
  8 +
  9 +public interface SubmitService {
  10 +
  11 + Page<SubmitFile> getAdminList(MessageSearchDto dto);
  12 +
  13 + Page<SubmitLine> getAppList(PointSearchDto dto);
  14 +
  15 + int create(SubmitFile submitFile);
  16 +
  17 + int delete(int id);
  18 +
  19 + int update(SubmitFile submitFile);
  20 +
  21 +}
... ...
src/main/java/com/sincere/student/service/UniversityService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/UniversityService.java
... ... @@ -0,0 +1,26 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.UniversitySearchDto;
  4 +import com.sincere.student.model.University;
  5 +import com.sincere.student.model.UniversityMajor;
  6 +import com.sincere.student.utils.Page;
  7 +
  8 +import java.util.List;
  9 +
  10 +public interface UniversityService {
  11 +
  12 +
  13 + Page<University> getList(UniversitySearchDto universitySearchDto);
  14 +
  15 + int create(University university);
  16 +
  17 + int delete(int id);
  18 +
  19 + int update(University university);
  20 +
  21 + int addMajor(List<UniversityMajor> list);
  22 +
  23 + Integer selectByName(String name);
  24 +
  25 + Integer selectIdByMajor(String major , int id);
  26 +}
... ...
src/main/java/com/sincere/student/service/UserService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/UserService.java
... ... @@ -0,0 +1,10 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.model.SysUser;
  4 +
  5 +public interface UserService {
  6 +
  7 + SysUser getByUser();
  8 +
  9 + int update (SysUser sysUser);
  10 +}
... ...
src/main/java/com/sincere/student/service/VideoService.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/VideoService.java
... ... @@ -0,0 +1,18 @@
  1 +package com.sincere.student.service;
  2 +
  3 +import com.sincere.student.dto.VideoSearchDto;
  4 +import com.sincere.student.model.Video;
  5 +import com.sincere.student.utils.Page;
  6 +
  7 +public interface VideoService {
  8 +
  9 + Page<Video> getList(VideoSearchDto dto);
  10 +
  11 + Video getDetail(int id);
  12 +
  13 + int create(Video video);
  14 +
  15 + int update(Video video);
  16 +
  17 + int delete(int id);
  18 +}
... ...
src/main/java/com/sincere/student/service/impl/AdvertServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/AdvertServiceImpl.java
... ... @@ -0,0 +1,52 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.sincere.student.enums.AdvertEnums;
  4 +import com.sincere.student.mapper.AdvertMapper;
  5 +import com.sincere.student.model.Advert;
  6 +import com.sincere.student.service.AdvertService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +import java.util.List;
  11 +
  12 +@Service
  13 +public class AdvertServiceImpl implements AdvertService {
  14 +
  15 + @Autowired
  16 + AdvertMapper advertMapper ;
  17 +
  18 + @Override
  19 + public Advert getScreen() {
  20 + List<Advert> list = advertMapper.getList(AdvertEnums.screen.getType());
  21 + if(list != null && list.size() > 0){
  22 + return list.get(0);
  23 + }else {
  24 + return null ;
  25 + }
  26 + }
  27 +
  28 + @Override
  29 + public List<Advert> getBanner() {
  30 + return advertMapper.getList(AdvertEnums.banner.getType());
  31 + }
  32 +
  33 + @Override
  34 + public Advert getDetail(int id) {
  35 + return advertMapper.getDetail(id);
  36 + }
  37 +
  38 + @Override
  39 + public int create(Advert advert) {
  40 + return advertMapper.create(advert);
  41 + }
  42 +
  43 + @Override
  44 + public int delete(int id) {
  45 + return advertMapper.delete(id);
  46 + }
  47 +
  48 + @Override
  49 + public int update(Advert advert) {
  50 + return advertMapper.update(advert);
  51 + }
  52 +}
... ...
src/main/java/com/sincere/student/service/impl/ArticleServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/ArticleServiceImpl.java
... ... @@ -0,0 +1,64 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.ArticleSearchDto;
  5 +import com.sincere.student.mapper.ArticleMapper;
  6 +import com.sincere.student.model.Article;
  7 +import com.sincere.student.service.ArticleService;
  8 +import com.sincere.student.utils.Page;
  9 +import org.apache.commons.lang3.StringUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.stereotype.Service;
  12 +
  13 +import java.util.List;
  14 +
  15 +@Service
  16 +public class ArticleServiceImpl implements ArticleService {
  17 +
  18 + @Autowired
  19 + ArticleMapper articleMapper;
  20 +
  21 + @Override
  22 + public Page<Article> getList(ArticleSearchDto articleSearchDto) {
  23 + Page<Article> result = new Page<>(articleSearchDto.getPage(),articleSearchDto.getPageSize());
  24 + PageHelper.startPage(articleSearchDto.getPage(),articleSearchDto.getPageSize());
  25 + if(StringUtils.isNotBlank(articleSearchDto.getTitle())){
  26 + articleSearchDto.setTitle("%"+articleSearchDto.getTitle()+"%");
  27 + }
  28 + List<Article> list = articleMapper.getList(articleSearchDto) ;
  29 + result.setList(list);
  30 + result.setCount(articleMapper.getListCount(articleSearchDto));
  31 + return result;
  32 + }
  33 +
  34 + @Override
  35 + public List<Article> getRelationList(int universityId) {
  36 + return articleMapper.getRelationList(universityId);
  37 + }
  38 +
  39 + @Override
  40 + public Article selectById(int id) {
  41 + return articleMapper.selectById(id);
  42 + }
  43 +
  44 + @Override
  45 + public int create(Article article) {
  46 + if(article.getType() == 1){
  47 + article.setColumnType(0);
  48 + }
  49 + return articleMapper.create(article);
  50 + }
  51 +
  52 + @Override
  53 + public int delete(int id) {
  54 + return articleMapper.delete(id);
  55 + }
  56 +
  57 + @Override
  58 + public int update(Article article) {
  59 + if(article.getType() == 1){
  60 + article.setColumnType(0);
  61 + }
  62 + return articleMapper.update(article);
  63 + }
  64 +}
... ...
src/main/java/com/sincere/student/service/impl/ColumnServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/ColumnServiceImpl.java
... ... @@ -0,0 +1,46 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.sincere.student.dto.ColumnDto;
  4 +import com.sincere.student.mapper.ColumnMapper;
  5 +import com.sincere.student.model.ColumnType;
  6 +import com.sincere.student.service.ColumnService;
  7 +import org.apache.commons.lang3.StringUtils;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Service;
  10 +
  11 +import java.util.List;
  12 +
  13 +@Service
  14 +public class ColumnServiceImpl implements ColumnService {
  15 +
  16 + @Autowired
  17 + ColumnMapper columnMapper ;
  18 +
  19 + @Override
  20 + public List<ColumnType> getList(ColumnDto columnDto) {
  21 + if(StringUtils.isNotBlank(columnDto.getName())){
  22 + columnDto.setName("%"+columnDto.getName()+"%");
  23 + }
  24 + return columnMapper.getList(columnDto);
  25 + }
  26 +
  27 + @Override
  28 + public ColumnType selectDetail(int id) {
  29 + return columnMapper.selectDetail(id);
  30 + }
  31 +
  32 + @Override
  33 + public int create(ColumnType columnType) {
  34 + return columnMapper.create(columnType);
  35 + }
  36 +
  37 + @Override
  38 + public int update(ColumnType columnType) {
  39 + return columnMapper.update(columnType);
  40 + }
  41 +
  42 + @Override
  43 + public int delete(int id) {
  44 + return columnMapper.delete(id);
  45 + }
  46 +}
... ...
src/main/java/com/sincere/student/service/impl/CommonServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/CommonServiceImpl.java
... ... @@ -0,0 +1,27 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.sincere.student.mapper.AreaMapper;
  4 +import com.sincere.student.model.Area;
  5 +import com.sincere.student.service.CommonService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.List;
  10 +
  11 +@Service
  12 +public class CommonServiceImpl implements CommonService {
  13 +
  14 + @Autowired
  15 + AreaMapper areaMapper ;
  16 +
  17 + @Override
  18 + public List<Area> getProvince() {
  19 + return areaMapper.getProvince();
  20 + }
  21 +
  22 + @Override
  23 + public List<Area> getCity(String code) {
  24 + code = code + "%" ;
  25 + return areaMapper.getCity(code);
  26 + }
  27 +}
... ...
src/main/java/com/sincere/student/service/impl/ConsultServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/ConsultServiceImpl.java
... ... @@ -0,0 +1,83 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.ConsultSearchDto;
  5 +import com.sincere.student.mapper.UniversityConsultDetailMapper;
  6 +import com.sincere.student.mapper.UniversityConsultMapper;
  7 +import com.sincere.student.model.Consult;
  8 +import com.sincere.student.model.UniversityConsult;
  9 +import com.sincere.student.model.UniversityConsultDetail;
  10 +import com.sincere.student.service.ConsultService;
  11 +import com.sincere.student.utils.Page;
  12 +import org.apache.commons.lang3.StringUtils;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.stereotype.Service;
  15 +
  16 +@Service
  17 +public class ConsultServiceImpl implements ConsultService {
  18 +
  19 + @Autowired
  20 + UniversityConsultMapper universityConsultMapper ;
  21 +
  22 + @Autowired
  23 + UniversityConsultDetailMapper universityConsultDetailMapper ;
  24 +
  25 +
  26 + @Override
  27 + public Page<Consult> getList(ConsultSearchDto consultSearchDto) {
  28 + Page<Consult> page = new Page<>(consultSearchDto.getPage(),consultSearchDto.getPageSize());
  29 + if(StringUtils.isNotBlank(consultSearchDto.getUniversityName())){
  30 + consultSearchDto.setUniversityName("%"+consultSearchDto.getUniversityName()+"%");
  31 + }
  32 + if(StringUtils.isNotBlank(consultSearchDto.getMajorName())){
  33 + consultSearchDto.setMajorName("%"+consultSearchDto.getMajorName()+"%");
  34 + }
  35 + PageHelper.startPage(consultSearchDto.getPage(),consultSearchDto.getPageSize());
  36 + page.setList(universityConsultMapper.getList(consultSearchDto));
  37 + page.setCount(universityConsultMapper.getListCount(consultSearchDto));
  38 + return page;
  39 + }
  40 +
  41 + @Override
  42 + public Page<Consult> getColumnList(int columnType , int page ,int pageSize) {
  43 + Page<Consult> result = new Page<>(page,pageSize);
  44 + PageHelper.startPage(page,pageSize);
  45 + result.setList(universityConsultMapper.getColumnList(columnType));
  46 + result.setCount(universityConsultMapper.getColumnListCount(columnType));
  47 + return result;
  48 + }
  49 +
  50 + @Override
  51 + public Consult getDetail(int id) {
  52 + Consult consult = universityConsultMapper.selectByPrimaryKey(id);
  53 + consult.setList(universityConsultDetailMapper.selectByConsult(id));
  54 + return consult ;
  55 + }
  56 +
  57 + @Override
  58 + public int create(UniversityConsult consult) {
  59 + universityConsultMapper.insert(consult);
  60 + for(UniversityConsultDetail detail : consult.getList()){
  61 + detail.setConsultId(consult.getId());
  62 + universityConsultDetailMapper.insert(detail);
  63 + }
  64 + return 1 ;
  65 + }
  66 +
  67 + @Override
  68 + public int update(UniversityConsult consult) {
  69 + universityConsultMapper.updateByPrimaryKeySelective(consult);
  70 + for(UniversityConsultDetail detail : consult.getList()){
  71 + universityConsultDetailMapper.updateByPrimaryKey(detail);
  72 + }
  73 + return 1 ;
  74 + }
  75 +
  76 + @Override
  77 + public int delete(int id) {
  78 + universityConsultMapper.deleteByPrimaryKey(id);
  79 + universityConsultDetailMapper.deleteByPrimaryKey(id);
  80 + return 1 ;
  81 +
  82 + }
  83 +}
... ...
src/main/java/com/sincere/student/service/impl/MajorServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/MajorServiceImpl.java
... ... @@ -0,0 +1,55 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.MajorSearchDto;
  5 +import com.sincere.student.mapper.MajorMapper;
  6 +import com.sincere.student.model.Major;
  7 +import com.sincere.student.service.MajorService;
  8 +import com.sincere.student.utils.Page;
  9 +import org.apache.commons.lang3.StringUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.stereotype.Service;
  12 +
  13 +import java.util.List;
  14 +
  15 +@Service
  16 +public class MajorServiceImpl implements MajorService {
  17 +
  18 + @Autowired
  19 + MajorMapper majorMapper ;
  20 +
  21 + @Override
  22 + public Page<Major> getList(MajorSearchDto majorSearchDto) {
  23 + Page<Major> page = new Page<>(majorSearchDto.getPage(),majorSearchDto.getPageSize());
  24 + Major major = new Major() ;
  25 + if(StringUtils.isNotBlank(majorSearchDto.getSearch())){
  26 + major.setMajor("%"+majorSearchDto.getSearch()+"%");
  27 + }
  28 + if(majorSearchDto.getPid() != 0){
  29 + major.setpId(majorSearchDto.getPid());
  30 + }
  31 + PageHelper.startPage(majorSearchDto.getPage(),majorSearchDto.getPageSize());
  32 + List<Major> list = majorMapper.getList(major);
  33 + page.setList(list);
  34 + page.setCount(majorMapper.getListCount(major));
  35 + return page ;
  36 + }
  37 +
  38 + @Override
  39 + public int create(Major major) {
  40 + if(major.getpId() == 0){ //说明是一级专业
  41 + major.setpId(-1);
  42 + }
  43 + return majorMapper.create(major);
  44 + }
  45 +
  46 + @Override
  47 + public int update(Major major) {
  48 + return majorMapper.update(major);
  49 + }
  50 +
  51 + @Override
  52 + public int delete(int id) {
  53 + return majorMapper.delete(id);
  54 + }
  55 +}
... ...
src/main/java/com/sincere/student/service/impl/MessageServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/MessageServiceImpl.java
... ... @@ -0,0 +1,64 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.MessageSearchDto;
  5 +import com.sincere.student.mapper.UniversityMessageMapper;
  6 +import com.sincere.student.mapper.UniversityReplyMapper;
  7 +import com.sincere.student.model.Message;
  8 +import com.sincere.student.model.Reply;
  9 +import com.sincere.student.service.MessageService;
  10 +import com.sincere.student.utils.Page;
  11 +import org.apache.commons.lang3.StringUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Service;
  14 +
  15 +@Service
  16 +public class MessageServiceImpl implements MessageService {
  17 +
  18 + @Autowired
  19 + UniversityMessageMapper messageMapper ;
  20 +
  21 + @Autowired
  22 + UniversityReplyMapper replyMapper ;
  23 +
  24 + @Override
  25 + public Page<Message> getList(MessageSearchDto messageSearchDto) {
  26 + Page<Message> page = new Page<>(messageSearchDto.getPage(),messageSearchDto.getPageSize());
  27 + if(StringUtils.isNotBlank(messageSearchDto.getSearch())){
  28 + messageSearchDto.setSearch("%"+messageSearchDto.getSearch()+"%");
  29 + }
  30 + PageHelper.startPage(messageSearchDto.getPage(),messageSearchDto.getPageSize());
  31 + page.setList(messageMapper.getList(messageSearchDto));
  32 + page.setCount(messageMapper.getListCount(messageSearchDto));
  33 + return page;
  34 + }
  35 +
  36 + @Override
  37 + public int deleteMessage(int id) {
  38 + messageMapper.deleteByPrimaryKey(id);
  39 + replyMapper.deleteByMessageId(id);
  40 + return 1;
  41 + }
  42 +
  43 + @Override
  44 + public int reply(Reply reply) {
  45 + return replyMapper.insert(reply);
  46 + }
  47 +
  48 + @Override
  49 + public int deleteReply(int id) {
  50 + return replyMapper.deleteByPrimaryKey(id);
  51 + }
  52 +
  53 + @Override
  54 + public Message getDetail(int id) {
  55 + Message message = messageMapper.getDetail(id);
  56 + message.setList(replyMapper.selectByMessageId(id));
  57 + return message ;
  58 + }
  59 +
  60 + @Override
  61 + public int create(Message message) {
  62 + return messageMapper.insert(message);
  63 + }
  64 +}
... ...
src/main/java/com/sincere/student/service/impl/ParameterServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/ParameterServiceImpl.java
... ... @@ -0,0 +1,35 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.sincere.student.mapper.ParameterMapper;
  4 +import com.sincere.student.model.Parameter;
  5 +import com.sincere.student.service.ParameterService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +import java.util.List;
  10 +
  11 +@Service
  12 +public class ParameterServiceImpl implements ParameterService {
  13 +
  14 + @Autowired
  15 + ParameterMapper parameterMapper ;
  16 +
  17 + @Override
  18 + public Parameter getByCode(String code) {
  19 + List<Parameter> list = parameterMapper.getByCode(code);
  20 + if(list != null && list.size() > 0){
  21 + return list.get(0);
  22 + }
  23 + return null;
  24 + }
  25 +
  26 + @Override
  27 + public int create(Parameter parameter) {
  28 + return parameterMapper.create(parameter);
  29 + }
  30 +
  31 + @Override
  32 + public int update(Parameter parameter) {
  33 + return parameterMapper.update(parameter);
  34 + }
  35 +}
... ...
src/main/java/com/sincere/student/service/impl/SubmitServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/SubmitServiceImpl.java
... ... @@ -0,0 +1,84 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.MessageSearchDto;
  5 +import com.sincere.student.dto.PointSearchDto;
  6 +import com.sincere.student.dto.submit.SubmitLine;
  7 +import com.sincere.student.mapper.UniversityPointMapper;
  8 +import com.sincere.student.mapper.UniversitySubmitFileMapper;
  9 +import com.sincere.student.model.Point;
  10 +import com.sincere.student.model.SubmitFile;
  11 +import com.sincere.student.service.SubmitService;
  12 +import com.sincere.student.utils.Page;
  13 +import org.apache.commons.lang3.StringUtils;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.stereotype.Service;
  16 +
  17 +import java.util.ArrayList;
  18 +import java.util.List;
  19 +
  20 +@Service
  21 +public class SubmitServiceImpl implements SubmitService {
  22 +
  23 + @Autowired
  24 + UniversityPointMapper pointMapper ;
  25 +
  26 + @Autowired
  27 + UniversitySubmitFileMapper submitFileMapper ;
  28 +
  29 + @Override
  30 + public Page<SubmitFile> getAdminList(MessageSearchDto dto) {
  31 + Page<SubmitFile> result = new Page<>(dto.getPage(),dto.getPageSize());
  32 + PageHelper.startPage(dto.getPage(),dto.getPageSize());
  33 + result.setList(submitFileMapper.getList(dto));
  34 + result.setCount(submitFileMapper.getListCount(dto));
  35 + return result;
  36 + }
  37 +
  38 + @Override
  39 + public Page<SubmitLine> getAppList(PointSearchDto dto) {
  40 + Page<SubmitLine> result = new Page<>(dto.getPage(),dto.getPageSize());
  41 + if(StringUtils.isNotBlank(dto.getMajorName())){
  42 + dto.setMajorName("%"+dto.getMajorName()+"%");
  43 + }
  44 + if(StringUtils.isNotBlank(dto.getUniversityName())){
  45 + dto.setUniversityName("%"+dto.getUniversityName()+"%");
  46 + }
  47 + PageHelper.startPage(dto.getPage(),dto.getPageSize());
  48 + result.setList(submitFileMapper.getAppList(dto));
  49 + result.setCount(submitFileMapper.getAppListCount(dto));
  50 + return result;
  51 + }
  52 +
  53 + @Override
  54 + public int create(SubmitFile submitFile) {
  55 + submitFileMapper.insert(submitFile);
  56 + int i = 0 ;
  57 + List<Point> list = new ArrayList<>();
  58 + for(Point point :submitFile.getList()){
  59 + point.setSubmitId(submitFile.getId());
  60 + i++ ;
  61 + list.add(point);
  62 + if(i % 100 == 0){
  63 + pointMapper.insertBatch(list);
  64 + list = new ArrayList<>();
  65 + }
  66 + }
  67 + if(list.size() > 0){
  68 + pointMapper.insertBatch(list);
  69 + }
  70 + return 1;
  71 + }
  72 +
  73 + @Override
  74 + public int delete(int id) {
  75 + submitFileMapper.deleteByPrimaryKey(id);
  76 + pointMapper.deleteBySubmit(id);
  77 + return 1;
  78 + }
  79 +
  80 + @Override
  81 + public int update(SubmitFile submitFile) {
  82 + return submitFileMapper.updateByPrimaryKey(submitFile);
  83 + }
  84 +}
... ...
src/main/java/com/sincere/student/service/impl/UniversityServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/UniversityServiceImpl.java
... ... @@ -0,0 +1,94 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.UniversitySearchDto;
  5 +import com.sincere.student.mapper.UniversityMajorMapper;
  6 +import com.sincere.student.mapper.UniversityMapper;
  7 +import com.sincere.student.model.University;
  8 +import com.sincere.student.model.UniversityMajor;
  9 +import com.sincere.student.service.UniversityService;
  10 +import com.sincere.student.utils.Page;
  11 +import org.apache.commons.lang3.StringUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Service;
  14 +
  15 +import java.util.ArrayList;
  16 +import java.util.HashMap;
  17 +import java.util.List;
  18 +import java.util.Map;
  19 +import java.util.logging.Handler;
  20 +
  21 +@Service
  22 +public class UniversityServiceImpl implements UniversityService {
  23 +
  24 + @Autowired
  25 + UniversityMapper universityMapper ;
  26 +
  27 + @Autowired
  28 + UniversityMajorMapper universityMajorMapper ;
  29 +
  30 +
  31 + @Override
  32 + public Page<University> getList(UniversitySearchDto universitySearchDto) {
  33 + Page<University> page = new Page<>(universitySearchDto.getPage(),universitySearchDto.getPageSize());
  34 + PageHelper.startPage(universitySearchDto.getPage(),universitySearchDto.getPageSize());
  35 + if(StringUtils.isNotBlank(universitySearchDto.getSearch())){
  36 + universitySearchDto.setSearch("%"+universitySearchDto.getSearch()+"%");
  37 + }
  38 + List<University> list = universityMapper.getList(universitySearchDto);
  39 + for(University university : list){
  40 + university.setMajorList(universityMajorMapper.selectUniversityMajor(university.getId()));
  41 + }
  42 + page.setList(list);
  43 + page.setCount(universityMapper.getListCount(universitySearchDto));
  44 + return page;
  45 + }
  46 +
  47 + @Override
  48 + public int create(University university) {
  49 + return universityMapper.create(university);
  50 + }
  51 +
  52 + @Override
  53 + public int delete(int id) {
  54 + universityMajorMapper.deleteByUniversityId(id);
  55 + return universityMapper.delete(id);
  56 + }
  57 +
  58 + @Override
  59 + public int update(University university) {
  60 + return universityMapper.update(university);
  61 + }
  62 +
  63 + @Override
  64 + public int addMajor(List<UniversityMajor> list) {
  65 + universityMajorMapper.deleteByUniversityId(list.get(0).getUniversityId());
  66 + List<UniversityMajor> result = new ArrayList<>();
  67 + int i = 0 ;
  68 + for(UniversityMajor universityMajor :list){
  69 + i++ ;
  70 + result.add(universityMajor);
  71 + if(i % 100 == 0){
  72 + universityMajorMapper.insertBatch(result);
  73 + result = new ArrayList<>();
  74 + }
  75 + }
  76 + if(result.size() > 0){
  77 + universityMajorMapper.insertBatch(result);
  78 + }
  79 + return 1;
  80 + }
  81 +
  82 + @Override
  83 + public Integer selectByName(String name) {
  84 + return universityMapper.selectByName(name);
  85 + }
  86 +
  87 + @Override
  88 + public Integer selectIdByMajor(String major , int id) {
  89 + Map<String ,String> map = new HashMap<>();
  90 + map.put("major",major);
  91 + map.put("id",id+"");
  92 + return universityMajorMapper.selectIdByMajor(map);
  93 + }
  94 +}
... ...
src/main/java/com/sincere/student/service/impl/UserServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/UserServiceImpl.java
... ... @@ -0,0 +1,24 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.sincere.student.mapper.SysUserMapper;
  4 +import com.sincere.student.model.SysUser;
  5 +import com.sincere.student.service.UserService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +@Service
  10 +public class UserServiceImpl implements UserService {
  11 +
  12 + @Autowired
  13 + SysUserMapper sysUserMapper;
  14 +
  15 + @Override
  16 + public SysUser getByUser() {
  17 + return sysUserMapper.selectByPrimaryKey(1);
  18 + }
  19 +
  20 + @Override
  21 + public int update(SysUser sysUser) {
  22 + return sysUserMapper.updateByPrimaryKeySelective(sysUser);
  23 + }
  24 +}
... ...
src/main/java/com/sincere/student/service/impl/VideoServiceImpl.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/service/impl/VideoServiceImpl.java
... ... @@ -0,0 +1,51 @@
  1 +package com.sincere.student.service.impl;
  2 +
  3 +import com.github.pagehelper.PageHelper;
  4 +import com.sincere.student.dto.VideoSearchDto;
  5 +import com.sincere.student.mapper.VideoMapper;
  6 +import com.sincere.student.model.Video;
  7 +import com.sincere.student.service.VideoService;
  8 +import com.sincere.student.utils.Page;
  9 +import org.apache.commons.lang3.StringUtils;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.stereotype.Service;
  12 +
  13 +@Service
  14 +public class VideoServiceImpl implements VideoService {
  15 +
  16 +
  17 + @Autowired
  18 + VideoMapper videoMapper ;
  19 +
  20 + @Override
  21 + public Page<Video> getList(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.getList(dto));
  28 + page.setCount(videoMapper.getListCount(dto));
  29 + return page;
  30 + }
  31 +
  32 + @Override
  33 + public Video getDetail(int id) {
  34 + return videoMapper.getById(id);
  35 + }
  36 +
  37 + @Override
  38 + public int create(Video video) {
  39 + return videoMapper.create(video);
  40 + }
  41 +
  42 + @Override
  43 + public int update(Video video) {
  44 + return videoMapper.update(video);
  45 + }
  46 +
  47 + @Override
  48 + public int delete(int id) {
  49 + return videoMapper.delete(id);
  50 + }
  51 +}
... ...
src/main/java/com/sincere/student/utils/ExcelUtils.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/utils/ExcelUtils.java
... ... @@ -0,0 +1,94 @@
  1 +package com.sincere.student.utils;
  2 +
  3 +import com.sincere.student.model.Point;
  4 +import org.apache.poi.hssf.usermodel.HSSFWorkbook;
  5 +import org.apache.poi.ss.usermodel.*;
  6 +import org.apache.poi.xssf.usermodel.XSSFWorkbook;
  7 +
  8 +import java.io.File;
  9 +import java.io.FileInputStream;
  10 +import java.io.InputStream;
  11 +import java.net.HttpURLConnection;
  12 +import java.net.URL;
  13 +import java.util.ArrayList;
  14 +import java.util.List;
  15 +
  16 +public class ExcelUtils {
  17 +
  18 +
  19 + public static InputStream GetFileInputStream(String fileUrl){
  20 + try{
  21 + URL url = new URL(fileUrl);
  22 + HttpURLConnection conn = (HttpURLConnection)url.openConnection();
  23 + //设置超时间为3秒
  24 + conn.setConnectTimeout(8*1000);
  25 + //得到输入流
  26 + InputStream inputStream = conn.getInputStream();
  27 +
  28 + return inputStream ;
  29 + }catch (Exception e){
  30 +
  31 + }
  32 + return null ;
  33 + }
  34 +
  35 + public static List<Point> analysisExcel(String url) throws ResultException{
  36 + try{
  37 + File excelFile = new File(url);
  38 + // 获得工作簿
  39 + String file = excelFile.getName();
  40 + Workbook workbook = null;
  41 + //InputStream inputStream = GetFileInputStream(url);
  42 + InputStream inputStream = new FileInputStream(url);
  43 + if(inputStream == null){
  44 + throw new ResultException(901,"路径错误");
  45 + }
  46 + if (file.endsWith("xls")) {
  47 + workbook = new HSSFWorkbook(inputStream);
  48 + } else {
  49 + workbook = new XSSFWorkbook(inputStream);
  50 + }
  51 + // 获得工作表
  52 + Sheet sheet = workbook.getSheetAt(0);
  53 + int rows = sheet.getPhysicalNumberOfRows();
  54 + List<Point> list = new ArrayList<>();
  55 + for (int i = 1; i <= rows; i++) {
  56 + // 获取第i行数据
  57 + Row sheetRow = sheet.getRow(i);
  58 + if(sheetRow != null){
  59 + Point point = new Point();
  60 + Cell cell1 = sheetRow.getCell(0);
  61 + if(cell1 != null){
  62 + cell1.setCellType(CellType.STRING);
  63 + point.setUniversityName(cell1.getStringCellValue().trim());
  64 + }
  65 + Cell cell2 = sheetRow.getCell(1);
  66 + if(cell2 != null){
  67 + cell2.setCellType(CellType.STRING);
  68 + point.setMajor(cell2.getStringCellValue().trim());
  69 + }
  70 + Cell cell3 = sheetRow.getCell(2);
  71 + if(cell3 != null){
  72 + cell3.setCellType(CellType.STRING);
  73 + point.setEnrollNumber(Integer.valueOf(cell3.getStringCellValue().trim()));
  74 + }
  75 + Cell cell4 = sheetRow.getCell(3);
  76 + if(cell4 != null){
  77 + cell4.setCellType(CellType.STRING);
  78 + point.setGrade(Integer.valueOf(cell4.getStringCellValue().trim()));
  79 + }
  80 + Cell cell5 = sheetRow.getCell(4);
  81 + if(cell5 != null){
  82 + cell5.setCellType(CellType.STRING);
  83 + point.setRank(Integer.valueOf(cell5.getStringCellValue().trim()));
  84 + }
  85 + list.add(point);
  86 + }
  87 + }
  88 + return list ;
  89 + }catch (Exception e){
  90 + e.printStackTrace();
  91 + throw new ResultException(999,"系统错误");
  92 + }
  93 + }
  94 +}
... ...
src/main/java/com/sincere/student/utils/HttpClientUtils.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/utils/HttpClientUtils.java
... ... @@ -0,0 +1,81 @@
  1 +package com.sincere.student.utils;
  2 +
  3 +import org.apache.http.HttpEntity;
  4 +import org.apache.http.client.ClientProtocolException;
  5 +import org.apache.http.client.config.RequestConfig;
  6 +import org.apache.http.client.methods.CloseableHttpResponse;
  7 +import org.apache.http.client.methods.HttpPost;
  8 +import org.apache.http.entity.ContentType;
  9 +import org.apache.http.entity.mime.MultipartEntityBuilder;
  10 +import org.apache.http.entity.mime.content.FileBody;
  11 +import org.apache.http.entity.mime.content.StringBody;
  12 +import org.apache.http.impl.client.CloseableHttpClient;
  13 +import org.apache.http.impl.client.HttpClients;
  14 +import org.apache.http.util.EntityUtils;
  15 +
  16 +import java.io.File;
  17 +import java.io.IOException;
  18 +
  19 +/**
  20 + * HttpClient4.3工具类
  21 + * @author chen
  22 + * @version 1.0
  23 + * @date 2019/10/11 0011 10:17
  24 + */
  25 +public class HttpClientUtils {
  26 +
  27 + private static RequestConfig requestConfig = null;
  28 +
  29 + static {
  30 + // 设置请求和传输超时时间
  31 + requestConfig = RequestConfig.custom().setSocketTimeout(5000).setConnectTimeout(5000).build();
  32 + }
  33 +
  34 + public static void main(String[] args){
  35 +// String url = "http://http://zhktest.114school.com.cn/szkjapi/toyxy/addTeacherOrg" ;
  36 +// String json = "{\"name\": \"子部门\",\"groupname\": \"父部门\",\"schoolid\": \"16\",\"token\": \"05719991\"}" ;
  37 +// JSONObject jsonObject = HttpClientUtils.httpPostJson(url,json);
  38 +// System.out.println(jsonObject.toJSONString());
  39 + }
  40 +
  41 +
  42 + public static String upload(String url, File file, String filename) {
  43 + CloseableHttpClient httpclient = HttpClients.createDefault();
  44 + try {
  45 + HttpPost httppost = new HttpPost(url);
  46 + RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(200000).setSocketTimeout(200000).build();
  47 + httppost.setConfig(requestConfig);
  48 + FileBody bin = new FileBody(file);
  49 + StringBody comment = new StringBody(filename, ContentType.TEXT_PLAIN);
  50 + HttpEntity reqEntity = MultipartEntityBuilder.create().addPart("file", bin).addPart("filename", comment).build();
  51 + httppost.setEntity(reqEntity);
  52 + httppost.setHeader("ossPath","test");
  53 + System.out.println("executing request " + httppost.getRequestLine());
  54 + CloseableHttpResponse response = httpclient.execute(httppost);
  55 + try {
  56 + System.out.println(response.getStatusLine());
  57 + HttpEntity resEntity = response.getEntity();
  58 + if (resEntity != null) {
  59 + String responseEntityStr = EntityUtils.toString(response.getEntity());
  60 + System.out.println(responseEntityStr);
  61 + return responseEntityStr ;
  62 + }
  63 + EntityUtils.consume(resEntity);
  64 + } finally {
  65 + response.close();
  66 + }
  67 + } catch (ClientProtocolException e) {
  68 + e.printStackTrace();
  69 + } catch (IOException e) {
  70 + e.printStackTrace();
  71 + } finally {
  72 + try {
  73 + httpclient.close();
  74 + } catch (IOException e) {
  75 + e.printStackTrace();
  76 + }
  77 + }
  78 + return null ;
  79 + }
  80 +
  81 + }
... ...
src/main/java/com/sincere/student/utils/Page.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/utils/Page.java
... ... @@ -0,0 +1,55 @@
  1 +package com.sincere.student.utils;
  2 +
  3 +import io.swagger.annotations.ApiModel;
  4 +import io.swagger.annotations.ApiModelProperty;
  5 +
  6 +import java.util.List;
  7 +
  8 +@ApiModel
  9 +public class Page<T> {
  10 +
  11 + @ApiModelProperty(value = "页码")
  12 + private int page ;
  13 + @ApiModelProperty(value = "每页数量")
  14 + private int pageSize ;
  15 + @ApiModelProperty(value = "总数")
  16 + private int count ;
  17 + private List<T> list ;
  18 +
  19 + public int getCount() {
  20 + return count;
  21 + }
  22 +
  23 + public void setCount(int count) {
  24 + this.count = count;
  25 + }
  26 +
  27 + public Page(int page, int pageSize) {
  28 + this.page = page;
  29 + this.pageSize = pageSize;
  30 + }
  31 +
  32 + public int getPage() {
  33 + return page;
  34 + }
  35 +
  36 + public void setPage(int page) {
  37 + this.page = page;
  38 + }
  39 +
  40 + public int getPageSize() {
  41 + return pageSize;
  42 + }
  43 +
  44 + public void setPageSize(int pageSize) {
  45 + this.pageSize = pageSize;
  46 + }
  47 +
  48 + public List<T> getList() {
  49 + return list;
  50 + }
  51 +
  52 + public void setList(List<T> list) {
  53 + this.list = list;
  54 + }
  55 +}
... ...
src/main/java/com/sincere/student/utils/ResultException.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/utils/ResultException.java
... ... @@ -0,0 +1,29 @@
  1 +package com.sincere.student.utils;
  2 +
  3 +public class ResultException extends Exception {
  4 +
  5 + private int code ;
  6 + private String message ;
  7 +
  8 + public int getCode() {
  9 + return code;
  10 + }
  11 +
  12 + public void setCode(int code) {
  13 + this.code = code;
  14 + }
  15 +
  16 + @Override
  17 + public String getMessage() {
  18 + return message;
  19 + }
  20 +
  21 + public void setMessage(String message) {
  22 + this.message = message;
  23 + }
  24 +
  25 + public ResultException(int code, String message) {
  26 + this.code = code;
  27 + this.message = message;
  28 + }
  29 +}
... ...
src/main/java/com/sincere/student/utils/TokenUtils.java 0 → 100644
  1 +++ a/src/main/java/com/sincere/student/utils/TokenUtils.java
... ... @@ -0,0 +1,95 @@
  1 +package com.sincere.student.utils;
  2 +
  3 +import com.nimbusds.jose.*;
  4 +import com.nimbusds.jose.crypto.MACSigner;
  5 +import com.nimbusds.jose.crypto.MACVerifier;
  6 +import com.nimbusds.jwt.JWTClaimsSet;
  7 +import com.nimbusds.jwt.SignedJWT;
  8 +import com.sincere.student.utils.ResultException;
  9 +
  10 +import java.util.Date;
  11 +import java.util.Objects;
  12 +
  13 +public class TokenUtils {
  14 +
  15 + /**
  16 + * 创建秘钥
  17 + */
  18 + private static final byte[] SECRET = "6MNSobBRCHGIO0fS6MNSobBRCHGWO0fS".getBytes();
  19 +
  20 + /**
  21 + * 过期时间5秒
  22 + */
  23 + private static final long EXPIRE_TIME = 1000 * 60 * 60 * 24 * 3;
  24 +
  25 +
  26 + /**
  27 + * 生成Token
  28 + * @param account
  29 + * @return
  30 + */
  31 + public static String buildToken(String account) {
  32 + try {
  33 + /**
  34 + * 1.创建一个32-byte的密匙
  35 + */
  36 + MACSigner macSigner = new MACSigner(SECRET);
  37 + /**
  38 + * 2. 建立payload 载体
  39 + */
  40 + JWTClaimsSet claimsSet = new JWTClaimsSet.Builder()
  41 + .expirationTime(new Date(System.currentTimeMillis() + EXPIRE_TIME))
  42 + .claim("ACCOUNT",account)
  43 + .build();
  44 +
  45 + /**
  46 + * 3. 建立签名
  47 + */
  48 + SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.HS256), claimsSet);
  49 + signedJWT.sign(macSigner);
  50 +
  51 + /**
  52 + * 4. 生成token
  53 + */
  54 + String token = signedJWT.serialize();
  55 + return token;
  56 + } catch (KeyLengthException e) {
  57 + e.printStackTrace();
  58 + } catch (JOSEException e) {
  59 + e.printStackTrace();
  60 + }
  61 + return null;
  62 + }
  63 +
  64 + /**
  65 + * 校验token
  66 + * @param token
  67 + * @return
  68 + */
  69 + public static String validToken(String token) throws ResultException {
  70 + try {
  71 + SignedJWT jwt = SignedJWT.parse(token);
  72 + JWSVerifier verifier = new MACVerifier(SECRET);
  73 + //校验是否有效
  74 + if (!jwt.verify(verifier)) {
  75 + throw new ResultException(-1, "Token 无效");
  76 + }
  77 +
  78 + //校验超时
  79 + Date expirationTime = jwt.getJWTClaimsSet().getExpirationTime();
  80 + if (new Date().after(expirationTime)) {
  81 + throw new ResultException(-2, "Token 已过期");
  82 + }
  83 +
  84 + //获取载体中的数据
  85 + Object account = jwt.getJWTClaimsSet().getClaim("ACCOUNT");
  86 + //是否有openUid
  87 + if (Objects.isNull(account)){
  88 + throw new ResultException(-3, "账号为空");
  89 + }
  90 + return account.toString();
  91 + } catch (Exception e) {
  92 + throw new ResultException(-4, "系统繁忙");
  93 + }
  94 + }
  95 +}
... ...
src/main/resources/application.yaml 0 → 100644
  1 +++ a/src/main/resources/application.yaml
... ... @@ -0,0 +1,31 @@
  1 +server:
  2 + port: 9010
  3 +
  4 +spring:
  5 + application:
  6 + name: student
  7 + datasource:
  8 + username: SZJXTUSER
  9 + password: xst200919
  10 + url: jdbc:sqlserver://60.190.202.57:14333;database=consultative
  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: /**
  24 +##mybatis
  25 +mybatis:
  26 + mapper-locations: classpath:mapper/*.xml
  27 + type-aliases-package: com.sincere.student.model
  28 +
  29 +Logger:
  30 + level:
  31 + com.sincere.student.mapper: info
0 32 \ No newline at end of file
... ...
src/main/resources/generatorConfig.xml 0 → 100644
  1 +++ a/src/main/resources/generatorConfig.xml
... ... @@ -0,0 +1,48 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE generatorConfiguration
  3 + PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
  5 +<generatorConfiguration>
  6 + <classPathEntry location="C://root//sqljdbc4-4.0.jar" />
  7 +
  8 + <context targetRuntime="MyBatis3" id="a">
  9 +
  10 + <!--<commentGenerator>
  11 + <!– 去除自动生成的注释 –>
  12 + <property name="suppressAllComments" value="true" />
  13 + </commentGenerator>-->
  14 + <!-- 是否生成注释 去除自动生成的注释-->
  15 + <commentGenerator>
  16 + <property name="suppressDate" value="true"/>
  17 +
  18 + <property name="suppressAllComments" value="true"/>
  19 + </commentGenerator>
  20 + <!-- 数据库连接配置 -->
  21 + <jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver"
  22 + connectionURL="jdbc:sqlserver://60.190.202.57:14333;database=consultative"
  23 + userId="SZJXTUSER"
  24 + password="xst200919" />
  25 +
  26 + <!-- 非必需,类型处理器,在数据库类型和java类型之间的转换控制-->
  27 + <javaTypeResolver>
  28 + <property name="forceBigDecimals" value="false"/>
  29 + </javaTypeResolver>
  30 +
  31 + <!--配置生成的实体包
  32 + targetPackage:生成的实体包位置,默认存放在src目录下
  33 + targetProject:目标工程名
  34 + -->
  35 + <javaModelGenerator targetPackage="com.sincere.student.model" targetProject="src/main/java" />
  36 +
  37 + <!-- 实体包对应映射文件位置及名称,默认存放在src目录下 -->
  38 + <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources" />
  39 + <!--生成Dao类存放位置-->
  40 + <javaClientGenerator type="XMLMAPPER" targetPackage="com.sincere.student.mapper" targetProject="src/main/java">
  41 + <property name="enableSubPackages" value="true"/>
  42 + </javaClientGenerator>
  43 + <!--生成对应表及类名-->
  44 + <table tableName="university_submit_file" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" enableSelectByPrimaryKey="true"
  45 + enableUpdateByPrimaryKey="true"
  46 + enableDeleteByPrimaryKey="true"></table>
  47 + </context>
  48 +</generatorConfiguration>
0 49 \ No newline at end of file
... ...
src/main/resources/mapper/AdvertMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/AdvertMapper.xml
... ... @@ -0,0 +1,51 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.AdvertMapper">
  4 +
  5 + <resultMap id="AdvertMap" type="com.sincere.student.model.Advert">
  6 + <id column="id" property="id"/>
  7 + <result column="type" property="type"/>
  8 + <result column="img_url" property="imgUrl"/>
  9 + <result column="url_link" property="urlLink"/>
  10 + <result column="sort" property="sort"/>
  11 + <result column="status" property="status"/>
  12 + <result column="create_time" property="createTime"/>
  13 + <result column="title" property="title"/>
  14 + </resultMap>
  15 +
  16 + <select id="getList" parameterType="java.lang.Integer" resultMap="AdvertMap">
  17 + select * from university_advert where type = #{type} order by sort
  18 + </select>
  19 +
  20 + <select id="getDetail" parameterType="java.lang.Integer" resultMap="AdvertMap">
  21 + select * from university_advert where id=#{id}
  22 + </select>
  23 +
  24 + <insert id="create" parameterType="com.sincere.student.model.Advert" >
  25 + insert into university_advert (type,img_url,url_link,sort,status,create_time,title)
  26 + values (#{type},#{imgUrl},#{urlLink},#{sort},#{status},GETDATE(),#{title})
  27 + </insert>
  28 +
  29 + <delete id="delete" parameterType="java.lang.Integer">
  30 + delete university_advert where id = #{id}
  31 + </delete>
  32 +
  33 + <update id="update" parameterType="com.sincere.student.model.Advert">
  34 + update university_advert
  35 + <trim prefix="set" suffixOverrides=",">
  36 + <if test="imgUrl!=null">
  37 + img_url=#{imgUrl},
  38 + </if>
  39 + <if test="sort!=null">
  40 + sort=#{sort},
  41 + </if>
  42 + <if test="urlLink!=null">
  43 + url_link=#{urlLink},
  44 + </if>
  45 + <if test="title!=null">
  46 + title=#{title},
  47 + </if>
  48 + </trim>
  49 + where id = #{id}
  50 + </update>
  51 +</mapper>
... ...
src/main/resources/mapper/AreaMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/AreaMapper.xml
... ... @@ -0,0 +1,18 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.AreaMapper">
  4 +
  5 + <resultMap id="AreaMap" type="com.sincere.student.model.Area">
  6 + <result column="area_code" property="code"/>
  7 + <result column="area_name" property="name"/>
  8 + </resultMap>
  9 +
  10 + <select id="getProvince" resultMap="AreaMap">
  11 + select * from sys_area where len(area_code)=2
  12 + </select>
  13 +
  14 + <select id="getCity" parameterType="java.lang.String" resultMap="AreaMap">
  15 + select * from sys_area where len(area_code) > 2 and area_code like #{code}
  16 + </select>
  17 +
  18 +</mapper>
... ...
src/main/resources/mapper/ArticleMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/ArticleMapper.xml
... ... @@ -0,0 +1,113 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.ArticleMapper">
  4 +
  5 + <resultMap id="ArticleMap" type="com.sincere.student.model.Article">
  6 + <id column="id" property="id"/>
  7 + <result column="title" property="title"/>
  8 + <result column="column_type" property="columnType"/>
  9 + <result column="university_id" property="universityId"/>
  10 + <result column="sort" property="sort"/>
  11 + <result column="context" property="context"/>
  12 + <result column="author" property="author"/>
  13 + <result column="image_url" property="imageUrl"/>
  14 + <result column="video_url" property="videoUrl"/>
  15 + <result column="article_link" property="articleLink"/>
  16 + <result column="good_number" property="goodNumber"/>
  17 + <result column="look_number" property="lookNumber"/>
  18 + <result column="create_time" property="createTime"/>
  19 + <result column="type" property="type"/>
  20 + </resultMap>
  21 +
  22 +
  23 + <select id="getListCount" parameterType="com.sincere.student.dto.ArticleSearchDto" resultType="java.lang.Integer">
  24 + select count(0) from university_article
  25 + <where>
  26 + <if test="title != null">
  27 + and title like #{title}
  28 + </if>
  29 + <if test="columnType != 0">
  30 + and column_type = #{columnType}
  31 + </if>
  32 + <if test="articleType != 0">
  33 + and type = #{articleType}
  34 + </if>
  35 + </where>
  36 + </select>
  37 +
  38 + <select id="getList" parameterType="com.sincere.student.dto.ArticleSearchDto" resultMap="ArticleMap">
  39 + select * from university_article
  40 + <where>
  41 + <if test="title != null">
  42 + and title like #{title}
  43 + </if>
  44 + <if test="columnType != 0">
  45 + and column_type = #{columnType}
  46 + </if>
  47 + <if test="articleType != 0">
  48 + and type = #{articleType}
  49 + </if>
  50 + </where>
  51 + order by sort
  52 + </select>
  53 +
  54 + <select id="getRelationList" parameterType="java.lang.Integer" resultMap="ArticleMap">
  55 + select top 3 * from university_article where university_id = #{universityId}
  56 + </select>
  57 +
  58 + <select id="selectById" parameterType="java.lang.Integer" resultMap="ArticleMap">
  59 + select * from university_article where id = #{id}
  60 + </select>
  61 +
  62 + <insert id="create" parameterType="com.sincere.student.model.Article" >
  63 + insert into university_article (title,column_type,university_id,sort,context,author,image_url,video_url,article_link,good_number,look_number,create_time,type)
  64 + values (#{title},#{columnType},#{universityId},#{sort},#{context},#{author},#{imageUrl},#{videoUrl},#{articleLink},#{goodNumber},#{lookNumber},GETDATE(),#{type})
  65 + </insert>
  66 +
  67 + <delete id="delete" parameterType="java.lang.Integer">
  68 + delete university_article where id = #{id}
  69 + </delete>
  70 +
  71 + <update id="update" parameterType="com.sincere.student.model.Article">
  72 + update university_article
  73 + <trim prefix="set" suffixOverrides=",">
  74 + <if test="title!=null">
  75 + title=#{title},
  76 + </if>
  77 + <if test="columnType!=null">
  78 + column_type=#{columnType},
  79 + </if>
  80 + <if test="universityName!=null">
  81 + university_name=#{universityName},
  82 + </if>
  83 + <if test="universityId!=null">
  84 + university_id=#{universityId},
  85 + </if>
  86 + <if test="sort!=null">
  87 + sort=#{sort},
  88 + </if>
  89 + <if test="context!=null">
  90 + context=#{context},
  91 + </if>
  92 + <if test="author!=null">
  93 + author=#{author},
  94 + </if>
  95 + <if test="imageUrl!=null">
  96 + image_url=#{imageUrl},
  97 + </if>
  98 + <if test="videoUrl!=null">
  99 + video_url=#{videoUrl},
  100 + </if>
  101 + <if test="articleLink!=null">
  102 + article_link=#{articleLink},
  103 + </if>
  104 + <if test="goodNumber!=null">
  105 + good_number=#{goodNumber},
  106 + </if>
  107 + <if test="lookNumber!=null">
  108 + look_number=#{lookNumber},
  109 + </if>
  110 + </trim>
  111 + where id = #{id}
  112 + </update>
  113 +</mapper>
... ...
src/main/resources/mapper/ColumnMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/ColumnMapper.xml
... ... @@ -0,0 +1,56 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.ColumnMapper">
  4 +
  5 + <resultMap id="ColumnMap" type="com.sincere.student.model.ColumnType">
  6 + <id column="id" property="id"/>
  7 + <result column="type" property="type"/>
  8 + <result column="name" property="name"/>
  9 + <result column="sort" property="sort"/>
  10 + <result column="create_time" property="createTime"/>
  11 + <result column="url_link" property="urlLink"/>
  12 + </resultMap>
  13 +
  14 +
  15 + <select id="getList" parameterType="com.sincere.student.dto.ColumnDto" resultMap="ColumnMap">
  16 + select * from university_column_type
  17 + <where>
  18 + <if test="type != 0">
  19 + and type = #{type}
  20 + </if>
  21 + <if test="name != null and name != ''">
  22 + and name like #{name}
  23 + </if>
  24 + </where>
  25 + order by sort
  26 + </select>
  27 +
  28 + <select id="selectDetail" parameterType="java.lang.Integer" resultMap="ColumnMap">
  29 + select * from university_column_type where id=#{id}
  30 + </select>
  31 +
  32 + <insert id="create" parameterType="com.sincere.student.model.ColumnType">
  33 + insert into university_column_type(type,name,sort,create_time,url_link)
  34 + values (#{type},#{name},#{sort},GETDATE(),#{urlLink})
  35 + </insert>
  36 +
  37 + <insert id="update" parameterType="com.sincere.student.model.ColumnType">
  38 + update university_column_type
  39 + <trim prefix="set" suffixOverrides=",">
  40 + <if test="name!=null">
  41 + name=#{name},
  42 + </if>
  43 + <if test="sort!=null">
  44 + sort=#{sort},
  45 + </if>
  46 + <if test="urlLink!=null">
  47 + url_link=#{urlLink},
  48 + </if>
  49 + </trim>
  50 + where id = #{id}
  51 + </insert>
  52 +
  53 + <delete id="delete" parameterType="java.lang.Integer">
  54 + delete university_column_type where id = #{id}
  55 + </delete>
  56 +</mapper>
... ...
src/main/resources/mapper/MajorMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/MajorMapper.xml
... ... @@ -0,0 +1,60 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.MajorMapper">
  4 +
  5 + <resultMap id="MajorMap" type="com.sincere.student.model.Major">
  6 + <id column="id" property="id"/>
  7 + <result column="major" property="major"/>
  8 + <result column="major_code" property="majorCode"/>
  9 + <result column="p_id" property="pId"/>
  10 + </resultMap>
  11 +
  12 + <select id="getList" parameterType="com.sincere.student.model.Major" resultMap="MajorMap">
  13 + select * from university_major
  14 + <where>
  15 + <if test="pId != 0">
  16 + and p_id = #{pId}
  17 + </if>
  18 + <if test="major != null">
  19 + and major like #{major}
  20 + </if>
  21 + </where>
  22 + </select>
  23 +
  24 + <select id="getListCount" parameterType="com.sincere.student.model.Major" resultType="java.lang.Integer">
  25 + select count(0) from university_major
  26 + <where>
  27 + <if test="pId >= 0">
  28 + and p_id = #{pId}
  29 + </if>
  30 + <if test="major != null">
  31 + and major like #{major}
  32 + </if>
  33 + <if test="majorCode != null">
  34 + and major_code like #{majorCode}
  35 + </if>
  36 + </where>
  37 + </select>
  38 +
  39 + <insert id="create" parameterType="com.sincere.student.model.Major" >
  40 + insert into university_major (major,major_code,p_id)
  41 + values (#{major},#{majorCode},#{pId})
  42 + </insert>
  43 +
  44 + <delete id="delete" parameterType="java.lang.Integer">
  45 + delete university_major where id = #{id}
  46 + </delete>
  47 +
  48 + <update id="update" parameterType="com.sincere.student.model.Major">
  49 + update university_major
  50 + <trim prefix="set" suffixOverrides=",">
  51 + <if test="major!=null">
  52 + major=#{major},
  53 + </if>
  54 + <if test="majorCode!=null">
  55 + major_code=#{majorCode},
  56 + </if>
  57 + </trim>
  58 + where id = #{id}
  59 + </update>
  60 +</mapper>
... ...
src/main/resources/mapper/ParameterMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/ParameterMapper.xml
... ... @@ -0,0 +1,23 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.ParameterMapper">
  4 +
  5 + <resultMap id="ParameterMap" type="com.sincere.student.model.Parameter">
  6 + <result column="code" property="code"/>
  7 + <result column="message" property="message"/>
  8 + </resultMap>
  9 +
  10 + <select id="getByCode" resultMap="ParameterMap">
  11 + select * from sys_parameter where code = #{code}
  12 + </select>
  13 +
  14 + <insert id="create" parameterType="com.sincere.student.model.Parameter" >
  15 + insert into sys_parameter values (#{code},#{message})
  16 + </insert>
  17 +
  18 + <update id="update" parameterType="com.sincere.student.model.Parameter">
  19 + update sys_parameter set message = #{message}
  20 + where code = #{code}
  21 + </update>
  22 +
  23 +</mapper>
... ...
src/main/resources/mapper/SysUserMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/SysUserMapper.xml
... ... @@ -0,0 +1,82 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.SysUserMapper">
  4 + <resultMap id="BaseResultMap" type="com.sincere.student.model.SysUser">
  5 + <id column="id" jdbcType="INTEGER" property="id" />
  6 + <result column="user_name" jdbcType="VARCHAR" property="userName" />
  7 + <result column="password" jdbcType="VARCHAR" property="password" />
  8 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  9 + </resultMap>
  10 + <sql id="Base_Column_List">
  11 + id, user_name, password, create_time
  12 + </sql>
  13 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  14 + select
  15 + <include refid="Base_Column_List" />
  16 + from sys_user
  17 + where id = #{id,jdbcType=INTEGER}
  18 + </select>
  19 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  20 + delete from sys_user
  21 + where id = #{id,jdbcType=INTEGER}
  22 + </delete>
  23 + <insert id="insert" parameterType="com.sincere.student.model.SysUser">
  24 + insert into sys_user (id, user_name, password,
  25 + create_time)
  26 + values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
  27 + #{createTime,jdbcType=TIMESTAMP})
  28 + </insert>
  29 + <insert id="insertSelective" parameterType="com.sincere.student.model.SysUser">
  30 + insert into sys_user
  31 + <trim prefix="(" suffix=")" suffixOverrides=",">
  32 + <if test="id != null">
  33 + id,
  34 + </if>
  35 + <if test="userName != null">
  36 + user_name,
  37 + </if>
  38 + <if test="password != null">
  39 + password,
  40 + </if>
  41 + <if test="createTime != null">
  42 + create_time,
  43 + </if>
  44 + </trim>
  45 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  46 + <if test="id != null">
  47 + #{id,jdbcType=INTEGER},
  48 + </if>
  49 + <if test="userName != null">
  50 + #{userName,jdbcType=VARCHAR},
  51 + </if>
  52 + <if test="password != null">
  53 + #{password,jdbcType=VARCHAR},
  54 + </if>
  55 + <if test="createTime != null">
  56 + #{createTime,jdbcType=TIMESTAMP},
  57 + </if>
  58 + </trim>
  59 + </insert>
  60 + <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.SysUser">
  61 + update sys_user
  62 + <set>
  63 + <if test="userName != null">
  64 + user_name = #{userName,jdbcType=VARCHAR},
  65 + </if>
  66 + <if test="password != null">
  67 + password = #{password,jdbcType=VARCHAR},
  68 + </if>
  69 + <if test="createTime != null">
  70 + create_time = #{createTime,jdbcType=TIMESTAMP},
  71 + </if>
  72 + </set>
  73 + where id = #{id,jdbcType=INTEGER}
  74 + </update>
  75 + <update id="updateByPrimaryKey" parameterType="com.sincere.student.model.SysUser">
  76 + update sys_user
  77 + set user_name = #{userName,jdbcType=VARCHAR},
  78 + password = #{password,jdbcType=VARCHAR},
  79 + create_time = #{createTime,jdbcType=TIMESTAMP}
  80 + where id = #{id,jdbcType=INTEGER}
  81 + </update>
  82 +</mapper>
0 83 \ No newline at end of file
... ...
src/main/resources/mapper/UniversityConsultDetailMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityConsultDetailMapper.xml
... ... @@ -0,0 +1,94 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.UniversityConsultDetailMapper">
  4 + <resultMap id="BaseResultMap" type="com.sincere.student.model.UniversityConsultDetail">
  5 + <id column="id" jdbcType="INTEGER" property="id" />
  6 + <result column="consult_id" jdbcType="INTEGER" property="consultId" />
  7 + <result column="column_name" jdbcType="VARCHAR" property="columnName" />
  8 + <result column="column_url" jdbcType="VARCHAR" property="columnUrl" />
  9 + <result column="sort" jdbcType="INTEGER" property="sort" />
  10 + </resultMap>
  11 + <sql id="Base_Column_List">
  12 + id, consult_id, column_name, column_url, sort
  13 + </sql>
  14 + <select id="selectByConsult" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  15 + select
  16 + <include refid="Base_Column_List" />
  17 + from university_consult_detail
  18 + where consult_id = #{id,jdbcType=INTEGER}
  19 + order by sort
  20 + </select>
  21 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  22 + delete from university_consult_detail
  23 + where consult_id = #{id,jdbcType=INTEGER}
  24 + </delete>
  25 + <insert id="insert" parameterType="com.sincere.student.model.UniversityConsultDetail">
  26 + insert into university_consult_detail ( consult_id, column_name,
  27 + column_url, sort)
  28 + values ( #{consultId,jdbcType=INTEGER}, #{columnName,jdbcType=VARCHAR},
  29 + #{columnUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER})
  30 + </insert>
  31 + <insert id="insertSelective" parameterType="com.sincere.student.model.UniversityConsultDetail">
  32 + insert into university_consult_detail
  33 + <trim prefix="(" suffix=")" suffixOverrides=",">
  34 + <if test="id != null">
  35 + id,
  36 + </if>
  37 + <if test="consultId != null">
  38 + consult_id,
  39 + </if>
  40 + <if test="columnName != null">
  41 + column_name,
  42 + </if>
  43 + <if test="columnUrl != null">
  44 + column_url,
  45 + </if>
  46 + <if test="sort != null">
  47 + sort,
  48 + </if>
  49 + </trim>
  50 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  51 + <if test="id != null">
  52 + #{id,jdbcType=INTEGER},
  53 + </if>
  54 + <if test="consultId != null">
  55 + #{consultId,jdbcType=INTEGER},
  56 + </if>
  57 + <if test="columnName != null">
  58 + #{columnName,jdbcType=VARCHAR},
  59 + </if>
  60 + <if test="columnUrl != null">
  61 + #{columnUrl,jdbcType=VARCHAR},
  62 + </if>
  63 + <if test="sort != null">
  64 + #{sort,jdbcType=INTEGER},
  65 + </if>
  66 + </trim>
  67 + </insert>
  68 + <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsultDetail">
  69 + update university_consult_detail
  70 + <set>
  71 + <if test="consultId != null">
  72 + consult_id = #{consultId,jdbcType=INTEGER},
  73 + </if>
  74 + <if test="columnName != null">
  75 + column_name = #{columnName,jdbcType=VARCHAR},
  76 + </if>
  77 + <if test="columnUrl != null">
  78 + column_url = #{columnUrl,jdbcType=VARCHAR},
  79 + </if>
  80 + <if test="sort != null">
  81 + sort = #{sort,jdbcType=INTEGER},
  82 + </if>
  83 + </set>
  84 + where id = #{id,jdbcType=INTEGER}
  85 + </update>
  86 + <update id="updateByPrimaryKey" parameterType="com.sincere.student.model.UniversityConsultDetail">
  87 + update university_consult_detail
  88 + set consult_id = #{consultId,jdbcType=INTEGER},
  89 + column_name = #{columnName,jdbcType=VARCHAR},
  90 + column_url = #{columnUrl,jdbcType=VARCHAR},
  91 + sort = #{sort,jdbcType=INTEGER}
  92 + where id = #{id,jdbcType=INTEGER}
  93 + </update>
  94 +</mapper>
0 95 \ No newline at end of file
... ...
src/main/resources/mapper/UniversityConsultMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityConsultMapper.xml
... ... @@ -0,0 +1,141 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.UniversityConsultMapper">
  4 +
  5 + <resultMap id="ListMap" type="com.sincere.student.model.Consult">
  6 + <result column="id" property="id" />
  7 + <result column="universityId" property="universityId" />
  8 + <result column="name" property="name" />
  9 + <result column="code" property="code" />
  10 + <result column="sort" property="sort" />
  11 + <result column="img_url" property="imgUrl" />
  12 + </resultMap>
  13 +
  14 + <select id="getListCount" parameterType="com.sincere.student.dto.ConsultSearchDto" resultType="java.lang.Integer">
  15 + select count(DISTINCT c.id) from university_consult c
  16 + join university_info info on c.university_id = info.id
  17 + join university_relate_major r on info.id = r.university_id
  18 + join university_major m on m.id = r.major_id
  19 + <where>
  20 + <if test="columnType != 0">
  21 + and c.column_type = #{columnType}
  22 + </if>
  23 + <if test="columnType == 0">
  24 + and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
  25 + </if>
  26 + <if test="province != null">
  27 + and info.province = #{province}
  28 + </if>
  29 + <if test="city != null">
  30 + and info.city = #{city}
  31 + </if>
  32 + <if test="universityName != null">
  33 + and info.name like #{universityName}
  34 + </if>
  35 + <if test="majorName != null">
  36 + and m.major like #{majorName}
  37 + </if>
  38 + </where>
  39 + </select>
  40 +
  41 + <select id="getList" parameterType="com.sincere.student.dto.ConsultSearchDto" resultMap="ListMap">
  42 + select DISTINCT c.id , info.id as universityId , c.img_url ,c.sort , info.name , info.code from university_consult c
  43 + join university_info info on c.university_id = info.id
  44 + join university_relate_major r on info.id = r.university_id
  45 + join university_major m on m.id = r.major_id
  46 + <where>
  47 + <if test="columnType != 0">
  48 + and c.column_type = #{columnType}
  49 + </if>
  50 + <if test="columnType == 0">
  51 + and c.column_type = (select top 1 id from university_column_type where type = 2 order by sort)
  52 + </if>
  53 + <if test="province != null">
  54 + and info.province = #{province}
  55 + </if>
  56 + <if test="city != null">
  57 + and info.city = #{city}
  58 + </if>
  59 + <if test="universityName != null">
  60 + and info.name like #{universityName}
  61 + </if>
  62 + <if test="majorName != null">
  63 + and m.major like #{majorName}
  64 + </if>
  65 + </where>
  66 + order by c.sort
  67 + </select>
  68 +
  69 + <select id="getColumnListCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  70 + select count(DISTINCT c.id) from university_consult c
  71 + join university_info info on c.university_id = info.id
  72 + where c.column_type = #{columnType}
  73 + </select>
  74 +
  75 + <select id="getColumnList" parameterType="java.lang.Integer" resultMap="ListMap">
  76 + select DISTINCT c.id , info.id as universityId , c.img_url ,c.sort , info.name , info.code from university_consult c
  77 + join university_info info on c.university_id = info.id
  78 + where c.column_type = #{columnType}
  79 + order by c.sort
  80 + </select>
  81 +
  82 + <resultMap id="DetailMap" type="com.sincere.student.model.Consult">
  83 + <result column="id" property="id" />
  84 + <result column="universityId" property="universityId" />
  85 + <result column="name" property="name" />
  86 + <result column="code" property="code" />
  87 + <result column="sort" property="sort" />
  88 + <result column="img_url" property="imgUrl" />
  89 + <result column="column_type" property="columnType" />
  90 + <result column="video_url" property="videoUrl" />
  91 + <result column="context" property="context" />
  92 + <result column="phone" property="phone" />
  93 + </resultMap>
  94 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="DetailMap">
  95 + select * from university_consult c
  96 + join university_info info on c.university_id = info.id
  97 + where c.id =#{id}
  98 + </select>
  99 +
  100 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  101 + delete from university_consult
  102 + where id = #{id,jdbcType=INTEGER}
  103 + </delete>
  104 + <insert id="insert" parameterType="com.sincere.student.model.UniversityConsult" useGeneratedKeys="true" keyProperty="id">
  105 + insert into university_consult (university_id, column_type,
  106 + video_url, context, img_url,
  107 + create_time, sort)
  108 + values (#{universityId,jdbcType=INTEGER}, #{columnType,jdbcType=INTEGER},
  109 + #{videoUrl,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},
  110 + #{createTime,jdbcType=TIMESTAMP}, #{sort,jdbcType=INTEGER})
  111 + </insert>
  112 +
  113 + <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.UniversityConsult">
  114 + update university_consult
  115 + <set>
  116 + <if test="universityId != null">
  117 + university_id = #{universityId,jdbcType=INTEGER},
  118 + </if>
  119 + <if test="columnType != null">
  120 + column_type = #{columnType,jdbcType=INTEGER},
  121 + </if>
  122 + <if test="videoUrl != null">
  123 + video_url = #{videoUrl,jdbcType=VARCHAR},
  124 + </if>
  125 + <if test="context != null">
  126 + context = #{context,jdbcType=VARCHAR},
  127 + </if>
  128 + <if test="imgUrl != null">
  129 + img_url = #{imgUrl,jdbcType=VARCHAR},
  130 + </if>
  131 + <if test="createTime != null">
  132 + create_time = #{createTime,jdbcType=TIMESTAMP},
  133 + </if>
  134 + <if test="sort != null">
  135 + sort = #{sort,jdbcType=INTEGER},
  136 + </if>
  137 + </set>
  138 + where id = #{id,jdbcType=INTEGER}
  139 + </update>
  140 +
  141 +</mapper>
0 142 \ No newline at end of file
... ...
src/main/resources/mapper/UniversityMajorMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityMajorMapper.xml
... ... @@ -0,0 +1,33 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.UniversityMajorMapper">
  4 +
  5 + <resultMap id="UniversityMajorMap" type="com.sincere.student.model.UniversityMajor">
  6 + <result column="university_id" property="universityId"/>
  7 + <result column="major_id" property="majorId"/>
  8 + </resultMap>
  9 +
  10 + <insert id="insertBatch" parameterType="java.util.List">
  11 + insert into university_relate_major ( university_id , major_id)
  12 + values
  13 + <foreach collection="list" item="emp" separator=",">
  14 + (#{emp.universityId,jdbcType=INTEGER}, #{emp.majorId,jdbcType=INTEGER})
  15 + </foreach>
  16 + </insert>
  17 +
  18 + <delete id="deleteByUniversityId" parameterType="java.lang.Integer">
  19 + delete university_relate_major where university_id = #{universityId}
  20 + </delete>
  21 +
  22 + <select id="selectUniversityMajor" parameterType="java.lang.Integer" resultType="java.lang.String" >
  23 + select m.major from university_relate_major r
  24 + join university_major m on m.id = r.major_id
  25 + where r.university_id = #{id}
  26 + </select>
  27 +
  28 + <select id="selectIdByMajor" parameterType="java.util.Map" resultType="java.lang.Integer">
  29 + select m.id from university_info info join university_relate_major rm on info.id=rm.university_id
  30 + join university_major m on rm.major_id = m.id
  31 + where m.major = #{major} and info.id = #{id}
  32 + </select>
  33 +</mapper>
... ...
src/main/resources/mapper/UniversityMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityMapper.xml
... ... @@ -0,0 +1,79 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.UniversityMapper">
  4 +
  5 + <resultMap id="UniversityMap" type="com.sincere.student.model.University">
  6 + <id column="id" property="id"/>
  7 + <result column="name" property="name"/>
  8 + <result column="code" property="code"/>
  9 + <result column="university_type" property="universityType"/>
  10 + <result column="department" property="department"/>
  11 + <result column="province" property="province"/>
  12 + <result column="city" property="city"/>
  13 + <result column="level" property="level"/>
  14 + <result column="create_time" property="createTime"/>
  15 + <result column="phone" property="phone"/>
  16 + </resultMap>
  17 +
  18 + <select id="getListCount" parameterType="com.sincere.student.dto.UniversitySearchDto" resultType="java.lang.Integer">
  19 + select count(0) from university_info
  20 + <where>
  21 + <if test="search != null">
  22 + and name like #{search}
  23 + </if>
  24 + </where>
  25 + </select>
  26 +
  27 + <select id="getList" parameterType="com.sincere.student.dto.UniversitySearchDto" resultMap="UniversityMap">
  28 + select * from university_info
  29 + <where>
  30 + <if test="search != null">
  31 + and name like #{search}
  32 + </if>
  33 + </where>
  34 + </select>
  35 +
  36 + <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})
  39 + </insert>
  40 +
  41 + <delete id="delete" parameterType="java.lang.Integer">
  42 + delete university_info where id = #{id}
  43 + </delete>
  44 +
  45 + <update id="update" parameterType="com.sincere.student.model.University">
  46 + update university_info
  47 + <trim prefix="set" suffixOverrides=",">
  48 + <if test="name!=null">
  49 + name=#{name},
  50 + </if>
  51 + <if test="code!=null">
  52 + code=#{code},
  53 + </if>
  54 + <if test="universityType!=null">
  55 + university_type=#{universityType},
  56 + </if>
  57 + <if test="department!=null">
  58 + department=#{department},
  59 + </if>
  60 + <if test="province!=null">
  61 + province=#{province},
  62 + </if>
  63 + <if test="city!=null">
  64 + city=#{city},
  65 + </if>
  66 + <if test="level!=null">
  67 + level=#{level},
  68 + </if>
  69 + <if test="phone!=null">
  70 + phone=#{phone},
  71 + </if>
  72 + </trim>
  73 + where id = #{id}
  74 + </update>
  75 +
  76 + <select id="selectByName" parameterType="java.lang.String" resultType="java.lang.Integer">
  77 + select id from university_info where name = #{name}
  78 + </select>
  79 +</mapper>
... ...
src/main/resources/mapper/UniversityMessageMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityMessageMapper.xml
... ... @@ -0,0 +1,83 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.UniversityMessageMapper">
  4 + <resultMap id="BaseResultMap" type="com.sincere.student.model.Message">
  5 + <result column="id" jdbcType="INTEGER" property="id" />
  6 + <result column="title" jdbcType="VARCHAR" property="title" />
  7 + <result column="context" jdbcType="VARCHAR" property="context" />
  8 + <result column="phone" jdbcType="VARCHAR" property="phone" />
  9 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  10 + </resultMap>
  11 +
  12 + <select id="getListCount" parameterType="com.sincere.student.dto.MessageSearchDto" resultType="java.lang.Integer">
  13 + select * from university_message
  14 + <where>
  15 + <if test="search != null">
  16 + and title like #{search}
  17 + </if>
  18 + </where>
  19 + </select>
  20 +
  21 + <select id="getList" parameterType="com.sincere.student.dto.MessageSearchDto" resultMap="BaseResultMap">
  22 + select * from university_message
  23 + <where>
  24 + <if test="search != null">
  25 + and title like #{search}
  26 + </if>
  27 + </where>
  28 + </select>
  29 +
  30 + <select id="getDetail" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  31 + select * from university_message m
  32 + where m.id=#{id}
  33 + </select>
  34 +
  35 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  36 + delete from university_message
  37 + where id = #{id,jdbcType=INTEGER}
  38 + </delete>
  39 +
  40 + <insert id="insert" parameterType="com.sincere.student.model.Message">
  41 + insert into university_message (title, context,
  42 + phone, create_time)
  43 + values (#{title,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR},
  44 + #{phone,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
  45 + </insert>
  46 + <insert id="insertSelective" parameterType="com.sincere.student.model.Message">
  47 + insert into university_message
  48 + <trim prefix="(" suffix=")" suffixOverrides=",">
  49 + <if test="id != null">
  50 + id,
  51 + </if>
  52 + <if test="title != null">
  53 + title,
  54 + </if>
  55 + <if test="context != null">
  56 + context,
  57 + </if>
  58 + <if test="phone != null">
  59 + phone,
  60 + </if>
  61 + <if test="createTime != null">
  62 + create_time,
  63 + </if>
  64 + </trim>
  65 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  66 + <if test="id != null">
  67 + #{id,jdbcType=INTEGER},
  68 + </if>
  69 + <if test="title != null">
  70 + #{title,jdbcType=VARCHAR},
  71 + </if>
  72 + <if test="context != null">
  73 + #{context,jdbcType=VARCHAR},
  74 + </if>
  75 + <if test="phone != null">
  76 + #{phone,jdbcType=VARCHAR},
  77 + </if>
  78 + <if test="createTime != null">
  79 + #{createTime,jdbcType=TIMESTAMP},
  80 + </if>
  81 + </trim>
  82 + </insert>
  83 +</mapper>
0 84 \ No newline at end of file
... ...
src/main/resources/mapper/UniversityPointMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityPointMapper.xml
... ... @@ -0,0 +1,137 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.UniversityPointMapper">
  4 + <resultMap id="BaseResultMap" type="com.sincere.student.model.Point">
  5 + <id column="id" jdbcType="INTEGER" property="id" />
  6 + <result column="submit_id" jdbcType="INTEGER" property="submitId" />
  7 + <result column="university_id" jdbcType="INTEGER" property="universityId" />
  8 + <result column="major_id" jdbcType="INTEGER" property="majorId" />
  9 + <result column="grade" jdbcType="VARCHAR" property="grade" />
  10 + <result column="enroll_number" jdbcType="INTEGER" property="enrollNumber" />
  11 + <result column="rank" jdbcType="INTEGER" property="rank" />
  12 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  13 + </resultMap>
  14 +
  15 + <insert id="insertBatch" parameterType="java.util.List">
  16 + insert into university_point (submit_id, university_id , major_id ,grade ,enroll_number ,rank,create_time)
  17 + values
  18 + <foreach collection="list" item="emp" separator=",">
  19 + (#{emp.submitId}, #{emp.universityId}, #{emp.majorId}, #{emp.grade}, #{emp.enrollNumber}, #{emp.rank},GETDATE())
  20 + </foreach>
  21 + </insert>
  22 +
  23 + <sql id="Base_Column_List">
  24 + id, submit_id, university_id, major_id, grade, enroll_number, rank, create_time
  25 + </sql>
  26 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  27 + select
  28 + <include refid="Base_Column_List" />
  29 + from university_point
  30 + where id = #{id,jdbcType=INTEGER}
  31 + </select>
  32 + <delete id="deleteBySubmit" parameterType="java.lang.Integer">
  33 + delete from university_point
  34 + where submit_id = #{id,jdbcType=INTEGER}
  35 + </delete>
  36 + <insert id="insert" parameterType="com.sincere.student.model.Point">
  37 + insert into university_point (id, submit_id, university_id,
  38 + major_id, grade, enroll_number,
  39 + rank, create_time)
  40 + values (#{id,jdbcType=INTEGER}, #{submitId,jdbcType=INTEGER}, #{universityId,jdbcType=INTEGER},
  41 + #{majorId,jdbcType=INTEGER}, #{grade,jdbcType=VARCHAR}, #{enrollNumber,jdbcType=INTEGER},
  42 + #{rank,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
  43 + </insert>
  44 + <insert id="insertSelective" parameterType="com.sincere.student.model.Point">
  45 + insert into university_point
  46 + <trim prefix="(" suffix=")" suffixOverrides=",">
  47 + <if test="id != null">
  48 + id,
  49 + </if>
  50 + <if test="submitId != null">
  51 + submit_id,
  52 + </if>
  53 + <if test="universityId != null">
  54 + university_id,
  55 + </if>
  56 + <if test="majorId != null">
  57 + major_id,
  58 + </if>
  59 + <if test="grade != null">
  60 + grade,
  61 + </if>
  62 + <if test="enrollNumber != null">
  63 + enroll_number,
  64 + </if>
  65 + <if test="rank != null">
  66 + rank,
  67 + </if>
  68 + <if test="createTime != null">
  69 + create_time,
  70 + </if>
  71 + </trim>
  72 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  73 + <if test="id != null">
  74 + #{id,jdbcType=INTEGER},
  75 + </if>
  76 + <if test="submitId != null">
  77 + #{submitId,jdbcType=INTEGER},
  78 + </if>
  79 + <if test="universityId != null">
  80 + #{universityId,jdbcType=INTEGER},
  81 + </if>
  82 + <if test="majorId != null">
  83 + #{majorId,jdbcType=INTEGER},
  84 + </if>
  85 + <if test="grade != null">
  86 + #{grade,jdbcType=VARCHAR},
  87 + </if>
  88 + <if test="enrollNumber != null">
  89 + #{enrollNumber,jdbcType=INTEGER},
  90 + </if>
  91 + <if test="rank != null">
  92 + #{rank,jdbcType=INTEGER},
  93 + </if>
  94 + <if test="createTime != null">
  95 + #{createTime,jdbcType=TIMESTAMP},
  96 + </if>
  97 + </trim>
  98 + </insert>
  99 + <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.Point">
  100 + update university_point
  101 + <set>
  102 + <if test="submitId != null">
  103 + submit_id = #{submitId,jdbcType=INTEGER},
  104 + </if>
  105 + <if test="universityId != null">
  106 + university_id = #{universityId,jdbcType=INTEGER},
  107 + </if>
  108 + <if test="majorId != null">
  109 + major_id = #{majorId,jdbcType=INTEGER},
  110 + </if>
  111 + <if test="grade != null">
  112 + grade = #{grade,jdbcType=VARCHAR},
  113 + </if>
  114 + <if test="enrollNumber != null">
  115 + enroll_number = #{enrollNumber,jdbcType=INTEGER},
  116 + </if>
  117 + <if test="rank != null">
  118 + rank = #{rank,jdbcType=INTEGER},
  119 + </if>
  120 + <if test="createTime != null">
  121 + create_time = #{createTime,jdbcType=TIMESTAMP},
  122 + </if>
  123 + </set>
  124 + where id = #{id,jdbcType=INTEGER}
  125 + </update>
  126 + <update id="updateByPrimaryKey" parameterType="com.sincere.student.model.Point">
  127 + update university_point
  128 + set submit_id = #{submitId,jdbcType=INTEGER},
  129 + university_id = #{universityId,jdbcType=INTEGER},
  130 + major_id = #{majorId,jdbcType=INTEGER},
  131 + grade = #{grade,jdbcType=VARCHAR},
  132 + enroll_number = #{enrollNumber,jdbcType=INTEGER},
  133 + rank = #{rank,jdbcType=INTEGER},
  134 + create_time = #{createTime,jdbcType=TIMESTAMP}
  135 + where id = #{id,jdbcType=INTEGER}
  136 + </update>
  137 +</mapper>
0 138 \ No newline at end of file
... ...
src/main/resources/mapper/UniversityReplyMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversityReplyMapper.xml
... ... @@ -0,0 +1,87 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.UniversityReplyMapper">
  4 + <resultMap id="BaseResultMap" type="com.sincere.student.model.Reply">
  5 + <id column="id" jdbcType="INTEGER" property="id" />
  6 + <result column="message_id" jdbcType="INTEGER" property="messageId" />
  7 + <result column="context" jdbcType="VARCHAR" property="context" />
  8 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  9 + </resultMap>
  10 + <sql id="Base_Column_List">
  11 + id, message_id, context, create_time
  12 + </sql>
  13 + <select id="selectByMessageId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  14 + select
  15 + <include refid="Base_Column_List" />
  16 + from university_reply
  17 + where message_id = #{id,jdbcType=INTEGER}
  18 + </select>
  19 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  20 + delete from university_reply
  21 + where id = #{id,jdbcType=INTEGER}
  22 + </delete>
  23 +
  24 + <delete id="deleteByMessageId" parameterType="java.lang.Integer">
  25 + delete from university_reply
  26 + where message_id = #{id,jdbcType=INTEGER}
  27 + </delete>
  28 + <insert id="insert" parameterType="com.sincere.student.model.Reply">
  29 + insert into university_reply (message_id, context,
  30 + create_time)
  31 + values (#{messageId,jdbcType=INTEGER}, #{context,jdbcType=VARCHAR},
  32 + #{createTime,jdbcType=TIMESTAMP})
  33 + </insert>
  34 + <insert id="insertSelective" parameterType="com.sincere.student.model.Reply">
  35 + insert into university_reply
  36 + <trim prefix="(" suffix=")" suffixOverrides=",">
  37 + <if test="id != null">
  38 + id,
  39 + </if>
  40 + <if test="messageId != null">
  41 + message_id,
  42 + </if>
  43 + <if test="context != null">
  44 + context,
  45 + </if>
  46 + <if test="createTime != null">
  47 + create_time,
  48 + </if>
  49 + </trim>
  50 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  51 + <if test="id != null">
  52 + #{id,jdbcType=INTEGER},
  53 + </if>
  54 + <if test="messageId != null">
  55 + #{messageId,jdbcType=INTEGER},
  56 + </if>
  57 + <if test="context != null">
  58 + #{context,jdbcType=VARCHAR},
  59 + </if>
  60 + <if test="createTime != null">
  61 + #{createTime,jdbcType=TIMESTAMP},
  62 + </if>
  63 + </trim>
  64 + </insert>
  65 + <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.Reply">
  66 + update university_reply
  67 + <set>
  68 + <if test="messageId != null">
  69 + message_id = #{messageId,jdbcType=INTEGER},
  70 + </if>
  71 + <if test="context != null">
  72 + context = #{context,jdbcType=VARCHAR},
  73 + </if>
  74 + <if test="createTime != null">
  75 + create_time = #{createTime,jdbcType=TIMESTAMP},
  76 + </if>
  77 + </set>
  78 + where id = #{id,jdbcType=INTEGER}
  79 + </update>
  80 + <update id="updateByPrimaryKey" parameterType="com.sincere.student.model.Reply">
  81 + update university_reply
  82 + set message_id = #{messageId,jdbcType=INTEGER},
  83 + context = #{context,jdbcType=VARCHAR},
  84 + create_time = #{createTime,jdbcType=TIMESTAMP}
  85 + where id = #{id,jdbcType=INTEGER}
  86 + </update>
  87 +</mapper>
0 88 \ No newline at end of file
... ...
src/main/resources/mapper/UniversitySubmitFileMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/UniversitySubmitFileMapper.xml
... ... @@ -0,0 +1,190 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sincere.student.mapper.UniversitySubmitFileMapper">
  4 +
  5 + <resultMap id="LineMap" type="com.sincere.student.dto.submit.SubmitLine">
  6 + <result column="id" property="id" />
  7 + <result column="title" property="title" />
  8 + <collection property="universityList" ofType="com.sincere.student.dto.submit.SubmitUniv">
  9 + <result column="universityId" property="universityId" />
  10 + <result column="name" property="universityName" />
  11 + <collection property="majorList" ofType="com.sincere.student.dto.submit.SubmitMajor">
  12 + <result column="major" property="major" />
  13 + <result column="grade" property="grade" />
  14 + <result column="enroll_number" property="enrollNumber" />
  15 + <result column="rank" property="rank" />
  16 + </collection>
  17 + </collection>
  18 + </resultMap>
  19 +
  20 + <select id="getAppListCount" parameterType="com.sincere.student.dto.PointSearchDto" resultType="java.lang.Integer">
  21 + select count(DISTINCT(sf.id))
  22 + from university_submit_file sf join university_point p on sf.id = p.submit_id
  23 + join university_info info on p.university_id = info.id
  24 + join university_major m on p.major_id = m.id
  25 + <where>
  26 + <if test="submitId != 0">
  27 + and sf.id = #{submitId}
  28 + </if>
  29 + <if test="universityName != null">
  30 + and info.name like #{universityName}
  31 + </if>
  32 + <if test="province != null">
  33 + and info.province = #{province}
  34 + </if>
  35 + <if test="city != null">
  36 + and info.city = #{city}
  37 + </if>
  38 + <if test="majorName != null">
  39 + and m.major like #{majorName}
  40 + </if>
  41 + <if test="point != 0 ">
  42 + <![CDATA[ and p.grade > #{point}-5 and p.grade < #{point} +5 ]]>
  43 + </if>
  44 + <if test="rank != 0 ">
  45 + <![CDATA[ and p.rank > #{rank}-100 and p.rank < #{rank} +100 ]]>
  46 + </if>
  47 + </where>
  48 + </select>
  49 +
  50 + <select id="getAppList" parameterType="com.sincere.student.dto.PointSearchDto" resultMap="LineMap">
  51 + select sf.id , sf.title ,info.id as universityId , info.name , m.major , p.enroll_number , p.rank , p.grade
  52 + from university_submit_file sf join university_point p on sf.id = p.submit_id
  53 + join university_info info on p.university_id = info.id
  54 + join university_major m on p.major_id = m.id
  55 + <where>
  56 + <if test="submitId != 0">
  57 + and sf.id = #{submitId}
  58 + </if>
  59 + <if test="universityName != null">
  60 + and info.name like #{universityName}
  61 + </if>
  62 + <if test="province != null">
  63 + and info.province = #{province}
  64 + </if>
  65 + <if test="city != null">
  66 + and info.city = #{city}
  67 + </if>
  68 + <if test="majorName != null">
  69 + and m.major like #{majorName}
  70 + </if>
  71 + <if test="point != 0 ">
  72 + <![CDATA[ and p.grade >= #{point}-5 and p.grade <= #{point} +5 ]]>
  73 + </if>
  74 + <if test="rank != 0 ">
  75 + <![CDATA[ and p.rank >= #{rank}-100 and p.rank <= #{rank} +100 ]]>
  76 + </if>
  77 + </where>
  78 + order by sf.id
  79 + </select>
  80 +
  81 + <resultMap id="BaseResultMap" type="com.sincere.student.model.SubmitFile">
  82 + <id column="id" jdbcType="INTEGER" property="id" />
  83 + <result column="title" jdbcType="VARCHAR" property="title" />
  84 + <result column="year" jdbcType="VARCHAR" property="year" />
  85 + <result column="sort" jdbcType="INTEGER" property="sort" />
  86 + <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  87 + </resultMap>
  88 +
  89 + <select id="getListCount" parameterType="com.sincere.student.dto.MessageSearchDto" resultType="java.lang.Integer">
  90 + select count(0) from university_submit_file
  91 + <where>
  92 + <if test="search != null">
  93 + title like #{search}
  94 + </if>
  95 + </where>
  96 + </select>
  97 +
  98 + <select id="getList" parameterType="com.sincere.student.dto.MessageSearchDto" resultMap="BaseResultMap">
  99 + select * from university_submit_file
  100 + <where>
  101 + <if test="search != null">
  102 + title like #{search}
  103 + </if>
  104 + </where>
  105 + order by sort
  106 + </select>
  107 +
  108 + <sql id="Base_Column_List">
  109 + id, title, year, sort, create_time
  110 + </sql>
  111 + <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  112 + select
  113 + <include refid="Base_Column_List" />
  114 + from university_submit_file
  115 + where id = #{id,jdbcType=INTEGER}
  116 + </select>
  117 + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  118 + delete from university_submit_file
  119 + where id = #{id,jdbcType=INTEGER}
  120 + </delete>
  121 + <insert id="insert" parameterType="com.sincere.student.model.SubmitFile" useGeneratedKeys="true" keyProperty="id">
  122 + insert into university_submit_file (title, year,
  123 + sort, create_time)
  124 + values (#{title,jdbcType=VARCHAR}, #{year,jdbcType=VARCHAR},
  125 + #{sort,jdbcType=INTEGER}, GETDATE())
  126 + </insert>
  127 + <insert id="insertSelective" parameterType="com.sincere.student.model.SubmitFile">
  128 + insert into university_submit_file
  129 + <trim prefix="(" suffix=")" suffixOverrides=",">
  130 + <if test="id != null">
  131 + id,
  132 + </if>
  133 + <if test="title != null">
  134 + title,
  135 + </if>
  136 + <if test="year != null">
  137 + year,
  138 + </if>
  139 + <if test="sort != null">
  140 + sort,
  141 + </if>
  142 + <if test="createTime != null">
  143 + create_time,
  144 + </if>
  145 + </trim>
  146 + <trim prefix="values (" suffix=")" suffixOverrides=",">
  147 + <if test="id != null">
  148 + #{id,jdbcType=INTEGER},
  149 + </if>
  150 + <if test="title != null">
  151 + #{title,jdbcType=VARCHAR},
  152 + </if>
  153 + <if test="year != null">
  154 + #{year,jdbcType=VARCHAR},
  155 + </if>
  156 + <if test="sort != null">
  157 + #{sort,jdbcType=INTEGER},
  158 + </if>
  159 + <if test="createTime != null">
  160 + #{createTime,jdbcType=TIMESTAMP},
  161 + </if>
  162 + </trim>
  163 + </insert>
  164 + <update id="updateByPrimaryKeySelective" parameterType="com.sincere.student.model.SubmitFile">
  165 + update university_submit_file
  166 + <set>
  167 + <if test="title != null">
  168 + title = #{title,jdbcType=VARCHAR},
  169 + </if>
  170 + <if test="year != null">
  171 + year = #{year,jdbcType=VARCHAR},
  172 + </if>
  173 + <if test="sort != null">
  174 + sort = #{sort,jdbcType=INTEGER},
  175 + </if>
  176 + <if test="createTime != null">
  177 + create_time = #{createTime,jdbcType=TIMESTAMP},
  178 + </if>
  179 + </set>
  180 + where id = #{id,jdbcType=INTEGER}
  181 + </update>
  182 + <update id="updateByPrimaryKey" parameterType="com.sincere.student.model.SubmitFile">
  183 + update university_submit_file
  184 + set title = #{title,jdbcType=VARCHAR},
  185 + year = #{year,jdbcType=VARCHAR},
  186 + sort = #{sort,jdbcType=INTEGER},
  187 + create_time = #{createTime,jdbcType=TIMESTAMP}
  188 + where id = #{id,jdbcType=INTEGER}
  189 + </update>
  190 +</mapper>
0 191 \ No newline at end of file
... ...
src/main/resources/mapper/VideoMapper.xml 0 → 100644
  1 +++ a/src/main/resources/mapper/VideoMapper.xml
... ... @@ -0,0 +1,75 @@
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.sincere.student.mapper.VideoMapper">
  4 +
  5 + <resultMap id="VideoMap" type="com.sincere.student.model.Video">
  6 + <id column="id" property="id"/>
  7 + <result column="university_id" property="universityId"/>
  8 + <result column="column_type" property="columnType"/>
  9 + <result column="video_url" property="videoUrl"/>
  10 + <result column="sort" property="sort"/>
  11 + <result column="create_time" property="createTime"/>
  12 + <result column="name" property="universityName"/>
  13 + <result column="code" property="universityCode"/>
  14 + </resultMap>
  15 +
  16 + <select id="getById" parameterType="java.lang.Integer" resultMap="VideoMap">
  17 + select * from university_video where id = #{id}
  18 + </select>
  19 +
  20 + <select id="getListCount" parameterType="com.sincere.student.dto.VideoSearchDto" resultType="java.lang.Integer">
  21 + select count(0) from university_video v join university_info info on v.university_id = info.id
  22 + <where>
  23 + <if test="universityName != 0">
  24 + and v.column_type = #{columnType}
  25 + </if>
  26 + <if test="universityName == 0">
  27 + and 1 = 1
  28 + </if>
  29 + <if test="universityName != null">
  30 + and info.name like #{universityName}
  31 + </if>
  32 + </where>
  33 + </select>
  34 +
  35 + <select id="getList" parameterType="com.sincere.student.dto.ArticleSearchDto" resultMap="VideoMap">
  36 + select v.*,info.name,info.code from university_video v join university_info info on v.university_id = info.id
  37 + <where>
  38 + <if test="universityName != null">
  39 + and info.name like #{universityName}
  40 + </if>
  41 + </where>
  42 + order by sort
  43 + </select>
  44 +
  45 + <insert id="create" parameterType="com.sincere.student.model.Video" >
  46 + insert into university_video (column_type,university_id,sort,video_url,create_time)
  47 + values (#{columnType},#{universityId},#{sort},#{videoUrl},GETDATE())
  48 + </insert>
  49 +
  50 + <delete id="delete" parameterType="java.lang.Integer">
  51 + delete university_video where id = #{id}
  52 + </delete>
  53 +
  54 + <update id="update" parameterType="com.sincere.student.model.Video">
  55 + update university_video
  56 + <trim prefix="set" suffixOverrides=",">
  57 + <if test="videoUrl!=null">
  58 + video_url=#{videoUrl},
  59 + </if>
  60 + <if test="columnType!=null">
  61 + column_type=#{columnType},
  62 + </if>
  63 + <if test="universityName!=null">
  64 + university_name=#{universityName},
  65 + </if>
  66 + <if test="universityId!=null">
  67 + university_id=#{universityId},
  68 + </if>
  69 + <if test="sort!=null">
  70 + sort=#{sort},
  71 + </if>
  72 + </trim>
  73 + where id = #{id}
  74 + </update>
  75 +</mapper>
... ...
src/main/resources/templates/index.html 0 → 100644
  1 +++ a/src/main/resources/templates/index.html
... ... @@ -0,0 +1,42 @@
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 +<head>
  4 + <meta charset="UTF-8">
  5 + <title>action is everything</title>
  6 +</head>
  7 +<body>
  8 +<div data-th-fragment="header">
  9 + <h1> 图片q </h1>
  10 +</div>
  11 +<form>
  12 + <input type="file" id="file" name="file">
  13 + <button type="button" onclick="submitForm()">提交</button>
  14 +
  15 +</form>
  16 +</body>
  17 +<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
  18 +<script>
  19 + function submitForm() {
  20 + var formData = new FormData(); //将需要提交的参数封装起来
  21 + formData.append("file", $("#file")[0].files[0]);
  22 + $.ajax({
  23 + //url:'upload',
  24 + url : 'http://121.40.109.21:8083/file-center/file/fileUpload',
  25 + beforeSend: function(xhr) {
  26 + xhr.setRequestHeader("ossPath","test");
  27 + },
  28 + type : 'post',
  29 + data : formData,
  30 + processData : false,
  31 + contentType : false,
  32 + success : function(value) {
  33 + alert(value);
  34 + },
  35 + error:function (value) {
  36 + alert(value);
  37 + }
  38 + });
  39 +
  40 + }
  41 +</script>
  42 +</html>
0 43 \ No newline at end of file
... ...