发表于: 2020-08-05 23:05:26

1 1995


今天完成的事情:

修改查看作品详情接口,查看作品列表接口

 查看作品详情接口

@Controller
@RequestMapping("/task3")
public class WorksDetailController {
@Autowired
   WorksDetailService worksDetailService;
   /**
    * 查看作品详情
    *
    * @param id
    * @return
    */
   @GetMapping(value = "/works/{id}")
@ResponseBody
   public Map<String, Object> showMessage(@PathVariable int id) {
Works works = worksDetailService.getWorksDetail(id);
       if(works!=null){
return Result.set(200,"查看作品详情成功",works);
       }else {
return Result.set(404,"展示作品详情失败");
       }
}
}

查看作品列表接口

@Controller
@RequestMapping("/task3")
public class ShowWorksController {
@Autowired
   ShowWorksService showWorksService;

   /**
    * 展示二级导航下的所有作品
    * @param secondId
    * @return
    */
   @GetMapping("/works/{secondId}")
@ResponseBody
   public Map<String,Object> showWorks(@PathVariable int secondId){
SecondPortFolio secondPortFolio=showWorksService.getAllWorkList(secondId);
       if(secondPortFolio!=null){
return Result.set(200,"展示作品成功",secondPortFolio.getWorksList());
       }else {
return Result.set(404,"展示作品失败");
       }
}
}

明天计划的事情:

1.恶补接口设计规范。

2.打日志。

3.学习springmvc的配置原理,和注解的作用。
遇到的问题: 
收获:


返回列表 返回列表
评论

    分享到