Commit eb713584 authored by liuchao's avatar liuchao

no message

parent df48e996
...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.qiankun.controller.base.BaseController; import com.qiankun.controller.base.BaseController;
import com.qiankun.entity.Points; import com.qiankun.entity.PointsType;
import com.qiankun.service.PointsService; import com.qiankun.service.PointsService;
@Controller @Controller
...@@ -31,7 +31,7 @@ public class PointsController extends BaseController<Object>{ ...@@ -31,7 +31,7 @@ public class PointsController extends BaseController<Object>{
@RequestMapping("/points/type/add") @RequestMapping("/points/type/add")
public ModelAndView typeAdd(String id) throws Exception { public ModelAndView typeAdd(String id) throws Exception {
ModelAndView view = new ModelAndView(); ModelAndView view = new ModelAndView();
Points type = new Points(); PointsType type = new PointsType();
if(StringUtils.isNotBlank(id)) { if(StringUtils.isNotBlank(id)) {
type = pointsService.findById(id); type = pointsService.findById(id);
} }
...@@ -42,10 +42,10 @@ public class PointsController extends BaseController<Object>{ ...@@ -42,10 +42,10 @@ public class PointsController extends BaseController<Object>{
} }
@RequestMapping("/points/type/save") @RequestMapping("/points/type/save")
public ModelAndView saveType(Points type, HttpServletResponse response, HttpServletRequest request) throws Exception { public ModelAndView saveType(PointsType type, HttpServletResponse response, HttpServletRequest request) throws Exception {
ModelAndView view = new ModelAndView(); ModelAndView view = new ModelAndView();
if (StringUtils.isNotEmpty(type.getId())) { if (StringUtils.isNotEmpty(type.getId())) {
Points t = pointsService.findById(type.getId()); PointsType t = pointsService.findById(type.getId());
t.setAvailable(type.isAvailable()); t.setAvailable(type.isAvailable());
t.setId(type.getId()); t.setId(type.getId());
t.setName(type.getName()); t.setName(type.getName());
......
package com.qiankun.dao; package com.qiankun.dao;
import com.qiankun.dao.core.IDao; import com.qiankun.dao.core.IDao;
import com.qiankun.entity.Points; import com.qiankun.entity.PointsType;
public interface PointsTypeDao extends IDao<Points, String> { public interface PointsTypeDao extends IDao<PointsType, String> {
} }
...@@ -3,10 +3,10 @@ package com.qiankun.dao; ...@@ -3,10 +3,10 @@ package com.qiankun.dao;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import com.qiankun.dao.core.AbsDao; import com.qiankun.dao.core.AbsDao;
import com.qiankun.entity.Points; import com.qiankun.entity.PointsType;
@Repository @Repository
public class PointsTypeDaoImpl extends AbsDao<Points, String> implements PointsTypeDao { public class PointsTypeDaoImpl extends AbsDao<PointsType, String> implements PointsTypeDao {
......
...@@ -13,7 +13,7 @@ import org.hibernate.annotations.GenericGenerator; ...@@ -13,7 +13,7 @@ import org.hibernate.annotations.GenericGenerator;
@Entity @Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Points { public class PointsType {
@Id @Id
@GenericGenerator(name = "systemUUID", strategy = "uuid2") @GenericGenerator(name = "systemUUID", strategy = "uuid2")
......
...@@ -24,7 +24,7 @@ public class UserPoints { ...@@ -24,7 +24,7 @@ public class UserPoints {
private String id; private String id;
@ManyToOne @ManyToOne
private Points type = new Points(); //积分类别 private PointsType type = new PointsType(); //积分类别
private Long point; //积分 private Long point; //积分
...@@ -41,11 +41,11 @@ public class UserPoints { ...@@ -41,11 +41,11 @@ public class UserPoints {
this.id = id; this.id = id;
} }
public Points getType() { public PointsType getType() {
return type; return type;
} }
public void setType(Points type) { public void setType(PointsType type) {
this.type = type; this.type = type;
} }
......
...@@ -7,7 +7,7 @@ import org.springframework.stereotype.Service; ...@@ -7,7 +7,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.qiankun.dao.PointsTypeDao; import com.qiankun.dao.PointsTypeDao;
import com.qiankun.entity.Points; import com.qiankun.entity.PointsType;
@Service @Service
public class PointsService { public class PointsService {
...@@ -15,14 +15,14 @@ public class PointsService { ...@@ -15,14 +15,14 @@ public class PointsService {
@Autowired @Autowired
private PointsTypeDao typeDao; private PointsTypeDao typeDao;
public Points findById(String id) { public PointsType findById(String id) {
Points type = typeDao.find(id); PointsType type = typeDao.find(id);
return type; return type;
} }
@Transactional @Transactional
public Points saveType(Points type) { public PointsType saveType(PointsType type) {
return typeDao.save(type); return typeDao.save(type);
} }
...@@ -32,8 +32,8 @@ public class PointsService { ...@@ -32,8 +32,8 @@ public class PointsService {
} }
public List<Points> findAllType() { public List<PointsType> findAllType() {
List<Points> list = typeDao.findAll(); List<PointsType> list = typeDao.findAll();
return list; return list;
} }
......
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