| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- package cn.iselab.mooctest.user.rpc;
- import cn.iselab.mooctest.rpc.user.api.IntegralService;
- import cn.iselab.mooctest.rpc.user.data.AddIntegralDTO;
- import cn.iselab.mooctest.rpc.user.data.IntegralCaughtDTO;
- import cn.iselab.mooctest.rpc.user.data.UserIntegralDTO;
- import cn.iselab.mooctest.user.web.logic.IntegralLogic;
- import com.alibaba.dubbo.config.annotation.Service;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import java.util.List;
- /**
- * @Author ROKG
- * @Description
- * @Date: Created in 下午12:09 2018/2/14
- * @Modified By:
- */
- @Service(version = "1.0.0")
- @Component
- public class IntegralRPC implements IntegralService {
- @Autowired
- IntegralLogic integralLogic;
- /**
- * save user caught integral
- * @param dto
- * @return medalTO
- */
- @Override
- public IntegralCaughtDTO saveIntegralCaught(IntegralCaughtDTO dto){
- return integralLogic.saveIntegralCaught(dto);
- }
- /**
- * get user's integral by time
- * @param userId user's id
- * @param startTime
- * @param endTime
- * @return medalTO
- */
- @Override
- public List<IntegralCaughtDTO> getIntegralCaughts(long userId, long startTime, long endTime){
- return integralLogic.getIntegralCaughts(userId,startTime,endTime);
- }
- /**
- * get user's integral ranking list
- * @param keyword search for single task
- * @return medalTO
- */
- @Override
- public List<UserIntegralDTO> getUserIntegrals(String keyword){
- return integralLogic.getUserIntegrals(keyword);
- }
- /**
- * check if user's event can bring integral
- * @param dto
- * @return
- */
- @Override
- public boolean checkIntegral(AddIntegralDTO dto){
- return integralLogic.addIntegral(dto);
- }
- /**
- * get user's integral by userId
- * @param userId
- * @return
- */
- @Override
- public UserIntegralDTO getUserIntegral(Long userId){
- return integralLogic.getUserIntegral(userId);
- }
- @Override
- public List<IntegralCaughtDTO> getUserIntegralRecord(long userId, long type, String source) {
- return integralLogic.getUserIntegralRecord(userId, type, source);
- }
- }
|