package cn.exploring.engine.server.db.service;

import cn.exploring.engine.server.db.dao.StudentPointInfoMapper;
import cn.exploring.engine.server.db.domain.StudentPointInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

@Service
public class StudentPointService {

    @Resource
    StudentPointInfoMapper studentPointInfoMapper;

//    public List<StudentPointInfo> selectPointInfo() {
//
//    }

    public Object addPoint(StudentPointInfo studentPoint) {
        LocalDateTime now = LocalDateTime.now();
        studentPoint.setUpdateTime(now);
        studentPoint.setAddTime(now);
        studentPoint.setDeleted(false);
        studentPointInfoMapper.insertSelective(studentPoint);
        return "add OK";
    }

    public Object updatePoint(StudentPointInfo studentPoint) {
        LocalDateTime now = LocalDateTime.now();
        studentPoint.setUpdateTime(now);
        studentPointInfoMapper.updateByPrimaryKey(studentPoint);
        return "update OK";
    }

}
