| | |
| | | package com.lf.server.service.sys; |
| | | |
| | | import com.lf.server.entity.data.DownloadEntity; |
| | | import com.lf.server.entity.sys.DownlogEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.mapper.sys.DownlogMapper; |
| | | import com.lf.server.service.data.DownloadService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.sql.Timestamp; |
| | | import java.util.List; |
| | | |
| | |
| | | public class DownlogService implements DownlogMapper { |
| | | @Autowired |
| | | DownlogMapper downlogMapper; |
| | | |
| | | @Autowired |
| | | DownloadService downloadService; |
| | | |
| | | @Override |
| | | public Integer selectCount(String uname, Integer type, Timestamp start, Timestamp end) { |
| | |
| | | public Integer updates(List<DownlogEntity> list) { |
| | | return downlogMapper.updates(list); |
| | | } |
| | | |
| | | /** |
| | | * 更新下载信息 |
| | | */ |
| | | public void updateInfos(UserEntity ue, DownloadEntity de, HttpServletRequest req) { |
| | | de.setDcount(de.getDcount() + 1); |
| | | de.setDownloadUser(ue.getId()); |
| | | int rows = downloadService.update(de); |
| | | |
| | | DownlogEntity entity = new DownlogEntity(); |
| | | entity.setDownid(de.getId()); |
| | | entity.setCreateUser(ue.getId()); |
| | | entity.setIp(WebHelper.getIpAddress(req)); |
| | | |
| | | rows = downlogMapper.insert(entity); |
| | | } |
| | | } |