Commit eb713584 authored by liuchao's avatar liuchao

no message

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