关于注解:
@Service
@Repository,@Mapper
@Controller,@GetMapping,@PostMapping
@Aspect,@Component
插入数据,包括自增的id
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
INSERT INTO ssm.Topic (title, content) VALUES (#{title}, #{content})
</insert>
动态路由
@GetMapping("/weibo/detail/{id}")
public ModelAndView detail(@PathVariable Integer id) {
AOP:
最常用来身份校验、打日志、
也可以写xml里,但是建议写在java里
@Aspect
@Component