java业务的过程_写一个java业务需要的步骤
————————————————————————————————————————————————————
先写bean包里的bean
再写dao interface xxxMapper @repository
定义个借口方法 int insert(singer singer);update delete selectbyprimarykey(integer id)
查询所有歌手 list《singer》allsingee()
然后resource的mapper.xml,根据adminMapper仿写
然后service接口,把mapper接口的所有方法复制过来,如果只是看下返回成功了没就把int改成boolean
然后写service.impl下的service实现类,要@service
private autowire mapper mapper
重写接口方法,返回mapper.方法
写controller,@restcontroller @reqstmapping(”/singer”)
autowire singerservice singerservice
public object addsinger(httpreq req)
jsonobject new
string name = req.getparameter()
实力化singer
singer.setname(name)
判断
返回jsonobject