| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class MatController extends BaseController { |
| | | |
| | | @Autowired |
| | | private MatService matService; |
| | | |
| | | @RequestMapping(value = "/mat/list/pda/auth") |
| | | @ManagerAuth |
| | | public R pdaList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = true)Long tagId){ |
| | | EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("tag_id", tagId); |
| | | wrapper.orderBy("create_time", false); |
| | | List<Mat> mats = matService.selectList(wrapper); |
| | | return R.ok().add(mats); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/{id}/auth") |
| | | @ManagerAuth |
| | |
| | | @RequestMapping(value = "/mat/add/auth") |
| | | @ManagerAuth |
| | | public R add(Mat mat) { |
| | | mat.setCreateBy(getUserId()); |
| | | mat.setCreateTime(new Date()); |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(new Date()); |
| | | matService.insert(mat); |
| | | return R.ok(); |
| | | } |
| | |
| | | if (Cools.isEmpty(mat) || null==mat.getId()){ |
| | | return R.error(); |
| | | } |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(new Date()); |
| | | matService.updateById(mat); |
| | | return R.ok(); |
| | | } |