1
22
23 package com.liferay.portlet.shopping.service.http;
24
25 import com.liferay.portlet.shopping.service.ShoppingCouponServiceUtil;
26
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29
30
74 public class ShoppingCouponServiceJSON {
75 public static JSONObject addCoupon(long plid, java.lang.String code,
76 boolean autoCode, java.lang.String name, java.lang.String description,
77 int startDateMonth, int startDateDay, int startDateYear,
78 int startDateHour, int startDateMinute, int endDateMonth,
79 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
80 boolean neverExpire, boolean active, java.lang.String limitCategories,
81 java.lang.String limitSkus, double minOrder, double discount,
82 java.lang.String discountType)
83 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
84 com.liferay.portal.PortalException {
85 com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.addCoupon(plid,
86 code, autoCode, name, description, startDateMonth,
87 startDateDay, startDateYear, startDateHour, startDateMinute,
88 endDateMonth, endDateDay, endDateYear, endDateHour,
89 endDateMinute, neverExpire, active, limitCategories, limitSkus,
90 minOrder, discount, discountType);
91
92 return ShoppingCouponJSONSerializer.toJSONObject(returnValue);
93 }
94
95 public static void deleteCoupon(long plid, long couponId)
96 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
97 com.liferay.portal.PortalException {
98 ShoppingCouponServiceUtil.deleteCoupon(plid, couponId);
99 }
100
101 public static JSONObject getCoupon(long plid, long couponId)
102 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
103 com.liferay.portal.PortalException {
104 com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.getCoupon(plid,
105 couponId);
106
107 return ShoppingCouponJSONSerializer.toJSONObject(returnValue);
108 }
109
110 public static JSONArray search(long plid, long companyId,
111 java.lang.String code, boolean active, java.lang.String discountType,
112 boolean andOperator, int begin, int end)
113 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
114 com.liferay.portal.PortalException {
115 java.util.List returnValue = ShoppingCouponServiceUtil.search(plid,
116 companyId, code, active, discountType, andOperator, begin, end);
117
118 return ShoppingCouponJSONSerializer.toJSONArray(returnValue);
119 }
120
121 public static JSONObject updateCoupon(long plid, long couponId,
122 java.lang.String name, java.lang.String description,
123 int startDateMonth, int startDateDay, int startDateYear,
124 int startDateHour, int startDateMinute, int endDateMonth,
125 int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
126 boolean neverExpire, boolean active, java.lang.String limitCategories,
127 java.lang.String limitSkus, double minOrder, double discount,
128 java.lang.String discountType)
129 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
130 com.liferay.portal.PortalException {
131 com.liferay.portlet.shopping.model.ShoppingCoupon returnValue = ShoppingCouponServiceUtil.updateCoupon(plid,
132 couponId, name, description, startDateMonth, startDateDay,
133 startDateYear, startDateHour, startDateMinute, endDateMonth,
134 endDateDay, endDateYear, endDateHour, endDateMinute,
135 neverExpire, active, limitCategories, limitSkus, minOrder,
136 discount, discountType);
137
138 return ShoppingCouponJSONSerializer.toJSONObject(returnValue);
139 }
140 }