| 725 |
chandransh |
1 |
package in.shop2020.creation.controllers;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
|
|
4 |
|
|
|
5 |
import java.util.Map;
|
|
|
6 |
|
|
|
7 |
import javax.servlet.http.HttpServletRequest;
|
|
|
8 |
import javax.servlet.http.HttpServletResponse;
|
|
|
9 |
|
|
|
10 |
import org.apache.juli.logging.Log;
|
|
|
11 |
import org.apache.juli.logging.LogFactory;
|
|
|
12 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
13 |
import org.apache.struts2.convention.annotation.Results;
|
|
|
14 |
import org.apache.struts2.interceptor.ParameterAware;
|
|
|
15 |
|
|
|
16 |
import com.opensymphony.xwork2.ValidationAwareSupport;
|
|
|
17 |
|
|
|
18 |
@Results({
|
|
|
19 |
@Result(name="success", type="redirectAction",
|
|
|
20 |
params = {"actionName" , "entity"})
|
|
|
21 |
})
|
|
|
22 |
public class ItemUpdateController extends ValidationAwareSupport implements ParameterAware {
|
|
|
23 |
|
|
|
24 |
private static final long serialVersionUID = 7180013499003793197L;
|
|
|
25 |
|
|
|
26 |
private Map<String, String[]> reqparams;
|
|
|
27 |
|
|
|
28 |
private static Log log = LogFactory.getLog(ItemUpdateController.class);
|
|
|
29 |
|
|
|
30 |
private String id;
|
|
|
31 |
|
|
|
32 |
public String show(){
|
|
|
33 |
try {
|
|
|
34 |
CatalogServiceClient csc = new CatalogServiceClient();
|
|
|
35 |
in.shop2020.model.v1.catalog.InventoryService.Client iclient = csc.getClient();
|
|
|
36 |
long entityId = Long.parseLong(getId());
|
|
|
37 |
iclient.markItemAsContentComplete(entityId);
|
|
|
38 |
} catch (Exception e) {
|
|
|
39 |
e.printStackTrace();
|
|
|
40 |
}
|
|
|
41 |
addActionMessage("Entity updated successfully");
|
|
|
42 |
return "success";
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
public String getId(){
|
|
|
46 |
return this.id;
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
public void setId(String id){
|
|
|
50 |
this.id = id;
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
@Override
|
|
|
54 |
public void setParameters(Map<String, String[]> reqmap) {
|
|
|
55 |
log.info("setParameters:" + reqmap);
|
|
|
56 |
|
|
|
57 |
this.reqparams = reqmap;
|
|
|
58 |
}
|
|
|
59 |
}
|