| | |
| | | package com.yeshi.buwan.controller; |
| | | |
| | | import com.yeshi.buwan.domain.system.DetailSystem; |
| | | import com.yeshi.buwan.domain.vip.OrderRecord; |
| | | import com.yeshi.buwan.exception.PPTVException; |
| | | import com.yeshi.buwan.exception.vip.VIPException; |
| | | import com.yeshi.buwan.funtv.FunTVUtil; |
| | | import com.yeshi.buwan.videos.funtv.FunTVUtil; |
| | | import com.yeshi.buwan.service.imp.DetailSystemConfigService; |
| | | import com.yeshi.buwan.service.imp.SearchService; |
| | | import com.yeshi.buwan.service.inter.order.OrderService; |
| | |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.yeshi.utils.JsonUtil; |
| | | import org.yeshi.utils.TimeUtil; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.PrintWriter; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | @Controller |
| | |
| | | out.print("success"); |
| | | } |
| | | |
| | | @RequestMapping("vipPay") |
| | | public void vipPay(String id) { |
| | | OrderRecord record = orderService.getOrderRecord(id); |
| | | try { |
| | | orderService.paySuccess(record.getId(), OrderRecord.PAY_WAY_ALIPAY, record.getMoney(), new Date()); |
| | | } catch (VIPException e) { |
| | | e.printStackTrace(); |
| | | } catch (PPTVException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | @RequestMapping("getTime") |
| | | public void getTime(PrintWriter out) { |
| | | |
| | | long time = System.currentTimeMillis(); |
| | | |
| | | String str = TimeUtil.getGernalTime(time, "yyyyMMdd HH:mm:ss"); |
| | | |
| | | out.print(String.format("time: %s format:%s", time + "", str)); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("searchAlbum") |
| | | public void searchAlbum(String key, PrintWriter out) { |
| | | SearchService.SearchResult result = searchService.searchAlbum(0, key, 1, 20); |
| | | SearchService.SearchResult result = searchService.searchAlbum(0, key, null, 1, 20, false); |
| | | out.print(JsonUtil.loadTrueResult(result)); |
| | | } |
| | | |
| | | // |
| | | // @RequestMapping("checkPay") |
| | | // public String checkPay(String loginUid,String id, PrintWriter out) { |
| | | // OrderRecord record = orderService.getOrderRecord(id); |
| | | // if (record == null || !record.getUid().equalsIgnoreCase(loginUid)) { |
| | | // return JsonUtilV2.loadFalseJson("记录不存在/不是您的订单"); |
| | | // } |
| | | // |
| | | // record = orderService.checkOrderPayState(id); |
| | | // //未支付 |
| | | // if (record != null && record.getState() != OrderRecord.STATE_PAY) { |
| | | // return JsonUtilV2.loadFalseJson(1, "支付未完成"); |
| | | // } |
| | | // |
| | | // JSONObject data = new JSONObject(); |
| | | // data.put("money", record.getPayMoney() == null ? record.getMoney() : record.getPayMoney()); |
| | | // |
| | | // return JsonUtilV2.loadTrueJson(data.toString()); |
| | | // } |
| | | |
| | | |
| | | } |