| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.example.ssmico.demos.web.entity.IcoNewCurrency; |
| | | import org.example.ssmico.demos.web.service.IcoNewCurrencySerivce; |
| | | import org.example.ssmico.demos.web.service.IcoOrderService; |
| | | import org.example.ssmico.demos.web.util.GoogleTranslateUtil; |
| | | import org.example.ssmico.demos.web.util.PageList; |
| | | import org.example.ssmico.demos.web.util.DateUtils; |
| | | import org.example.ssmico.demos.web.util.ResultObject; |
| | | import org.example.ssmico.demos.web.util.ServerResponse; |
| | | import org.example.ssmico.demos.web.vo.IcoNewCurrencyVo; |
| | | import org.modelmapper.ModelMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.support.ClassPathXmlApplicationContext; |
| | | import org.springframework.jdbc.core.BeanPropertyRowMapper; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | |
| | | import static cn.hutool.json.XMLTokener.entity; |
| | | |
| | | /** |
| | | * @program: dabao |
| | |
| | | |
| | | /** |
| | | * 新币添加 |
| | | * @param icoNewCurrency |
| | | * @param icoNewCurrencyVo |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/add.action", method = RequestMethod.POST, produces = "application/json;charset=UTF-8") |
| | | public ServerResponse add(IcoNewCurrency icoNewCurrency) { |
| | | public ServerResponse add(@RequestBody IcoNewCurrencyVo icoNewCurrencyVo) { |
| | | try { |
| | | IcoNewCurrency icoNewCurrency = new ModelMapper().map(icoNewCurrencyVo, IcoNewCurrency.class); |
| | | if(StringUtils.isNotBlank(icoNewCurrencyVo.getListingTime())){ |
| | | icoNewCurrency.setListingTime(DateUtils.toDateHms(icoNewCurrencyVo.getListingTime())); |
| | | } |
| | | if(StringUtils.isNotBlank(icoNewCurrencyVo.getApplicationStartTime())){ |
| | | icoNewCurrency.setApplicationStartTime(DateUtils.toDateHms(icoNewCurrencyVo.getApplicationStartTime())); |
| | | } |
| | | if(StringUtils.isNotBlank(icoNewCurrencyVo.getApplicationEndTime())){ |
| | | icoNewCurrency.setApplicationEndTime(DateUtils.toDateHms(icoNewCurrencyVo.getApplicationEndTime())); |
| | | } |
| | | long count = icoNewCurrencySerivce.count(new LambdaQueryWrapper<IcoNewCurrency>() |
| | | .eq(IcoNewCurrency::getTokenCode,icoNewCurrency.getTokenCode()).eq(IcoNewCurrency::getType,icoNewCurrency.getType())); |
| | | |
| | |
| | | |
| | | /** |
| | | * 修改ico |
| | | * @param icoNewCurrency |
| | | * @param icoNewCurrencyVo |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/update.action", method = RequestMethod.POST, produces = "application/json;charset=UTF-8") |
| | | public ServerResponse update(IcoNewCurrency icoNewCurrency,HttpServletRequest request) { |
| | | public ServerResponse update(@RequestBody IcoNewCurrencyVo icoNewCurrencyVo) { |
| | | try { |
| | | IcoNewCurrency icoNewCurrency = new ModelMapper().map(icoNewCurrencyVo, IcoNewCurrency.class); |
| | | if(StringUtils.isNotBlank(icoNewCurrencyVo.getListingTime())){ |
| | | icoNewCurrency.setListingTime(DateUtils.toDateHms(icoNewCurrencyVo.getListingTime())); |
| | | } |
| | | if(StringUtils.isNotBlank(icoNewCurrencyVo.getApplicationStartTime())){ |
| | | icoNewCurrency.setApplicationStartTime(DateUtils.toDateHms(icoNewCurrencyVo.getApplicationStartTime())); |
| | | } |
| | | if(StringUtils.isNotBlank(icoNewCurrencyVo.getApplicationEndTime())){ |
| | | icoNewCurrency.setApplicationEndTime(DateUtils.toDateHms(icoNewCurrencyVo.getApplicationEndTime())); |
| | | } |
| | | long count = icoNewCurrencySerivce.count(new LambdaQueryWrapper<IcoNewCurrency>() |
| | | .eq(IcoNewCurrency::getTokenCode,icoNewCurrency.getTokenCode()) |
| | | .ne(IcoNewCurrency::getId, icoNewCurrency.getId()) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取ICO |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/getById.action", method = RequestMethod.POST, produces = "application/json;charset=UTF-8") |
| | | public ServerResponse<IcoNewCurrency> getById(String id) { |
| | | return ServerResponse.createBySuccess(icoNewCurrencySerivce.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除ico |
| | | * @param id |
| | | * @return |