| | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.yeshi.buwan.dao.LoginUserDao; |
| | | import com.yeshi.buwan.dao.user.LoginUserDao; |
| | | import com.yeshi.buwan.dao.shop.ShopItemCollectDao; |
| | | import com.yeshi.buwan.dao.shop.ShopItemCommentDao; |
| | | import com.yeshi.buwan.domain.LoginUser; |
| | | import com.yeshi.buwan.domain.user.LoginUser; |
| | | import com.yeshi.buwan.domain.entity.ReturnResult; |
| | | import com.yeshi.buwan.domain.shop.ShopGoodsItem; |
| | | import com.yeshi.buwan.domain.shop.ShopItemCollect; |
| | |
| | | |
| | | @Service |
| | | public class ShopService { |
| | | final static String HOST = "http://buwantb.yeshitv.com:8080/TaoBaoKe/";// 10.251.33.117 |
| | | final static String HOST = "http://111.231.250.166:8087//TaoBaoKe/";// 10.251.33.117 |
| | | |
| | | // private static final String HOST ="http://192.168.1.200:8088/TaoBaoKe/"; |
| | | @Resource |
| | |
| | | @Resource |
| | | private ShopItemCommentDao shopItemCommentDao; |
| | | |
| | | @Cacheable(value = "shopCache", key = "'getItemList-'+#page") |
| | | private String getItemList(int page) { |
| | | return HttpUtil.get(HOST + "api/buwan/itemlist?page=" + page, "ISO-8859-1"); |
| | | } |
| | | |
| | | public List<ShopGoodsItem> getGoodsList(final String uid, int page) { |
| | | final List<ShopGoodsItem> list = new ArrayList<ShopGoodsItem>(); |
| | | final List<ShopGoodsItem> list = new ArrayList<>(); |
| | | String result = getItemList(page); |
| | | System.out.println(result); |
| | | |
| | |
| | | } |
| | | |
| | | public ReturnResult getGoodsListAdmin(int page, String key, int show) { |
| | | final List<ShopGoodsItem> list = new ArrayList<ShopGoodsItem>(); |
| | | final List<ShopGoodsItem> list = new ArrayList<>(); |
| | | String result = ""; |
| | | try { |
| | | result = HttpUtil.get(String.format(HOST + "api/buwan/admin/itemlist?page=%s&show=%s&key=%s", page + "", |
| | |
| | | |
| | | @Cacheable(value = "shopCache", key = "'getGoodsSimpleDetail-'+#md5") |
| | | public List<ShopGoodsItem> getGoodsSimpleDetail(long[] ids, String md5) { |
| | | List<ShopGoodsItem> list = new ArrayList<ShopGoodsItem>(); |
| | | List<ShopGoodsItem> list = new ArrayList<>(); |
| | | Gson gson = new GsonBuilder().create(); |
| | | String idStr = ""; |
| | | for (long id : ids) { |
| | |
| | | return true; |
| | | } |
| | | } catch (Exception e) { |
| | | if (session.getTransaction().isActive()) |
| | | session.getTransaction().rollback(); |
| | | } |
| | | return false; |