Commit 53080717 by whl

添加指标搜索页面及controller

parent 1fa34c77
...@@ -84,6 +84,12 @@ ...@@ -84,6 +84,12 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId> <artifactId>spring-boot-starter-aop</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.bsoft.api.controller;
import com.bsoft.api.model.respmodel.IndInfo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.List;
@RequestMapping("ind")
@Controller
public class IndController {
@GetMapping
public ModelAndView index(Model model, String filter){
model.addAttribute("title", "指标搜索");
// TODO 查询指标数据
List<IndInfo> list = new ArrayList<IndInfo>(){
{
add(new IndInfo(){
{
setCode("1");
setName("指标1");
setFieldName("ZB");
}
});
}
};
model.addAttribute("indList", list);
model.addAttribute("filter", filter==null?"":filter);
ModelAndView mav = new ModelAndView("ind", "indModel", model);
return mav;
}
@PostMapping("search")
public ModelAndView search(String filter){
return new ModelAndView("redirect:/ind?filter=" + filter);
}
}
...@@ -26,3 +26,13 @@ spring.redis.timeout=10000 ...@@ -26,3 +26,13 @@ spring.redis.timeout=10000
swagger.enabled=true swagger.enabled=true
swagger.basePackage=com.bsoft.api.controller swagger.basePackage=com.bsoft.api.controller
spring.mvc.view.prefix=/WEB-INF/views/
spring.mvc.view.suffix=.jsp
#Thymeleaf\u914D\u7F6E
spring.thymeleaf.cache=false
spring.thymeleaf.encoding=utf-8
spring.thymeleaf.mode=HTML5
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment