Subversion Repositories SmartDukaan

Rev

Rev 21920 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21920 rajender 1
package in.shop2020.dtrapi.controllers;
2
 
3
import java.util.Arrays;
4
import java.util.List;
5
 
6
import com.google.gson.Gson;
7
 
8
import in.shop2020.dtrapi.Storage.Mongo;
9
import in.shop2020.dtrapi.models.FofoForm;
10
 
11
public class FofoController extends BaseController {
12
	/**
13
	 * 
14
	 */
15
	private static List<String> DOCUMENT_NAMES = Arrays.asList("bEntityDoc","angleDoc1","gstDoc","panDoc","itrDoc","angleDoc2","angleDoc3","angleDoc4","angleDoc5","ownershipDoc","insuranceDoc","loanDoc","sanctionDoc","chequeCopy");
16
 
17
	private static final long serialVersionUID = 1L;
18
 
19
	private int id;
20
 
21
 
22
	public String index(){
23
		return "index";
24
	}
25
 
26
	public String edit(){
27
		return "edit";
28
	}
29
 
30
 
31
	public int getId() {
32
		return id;
33
	}
34
 
35
	public void setId(int id) {
36
		this.id = id;
37
	}
38
 
39
 
40
	public FofoForm fofoForm() {
41
		FofoForm x = Mongo.getFofoForm(id);
42
		System.out.println(x.toString());
43
		return x;
44
	}
45
 
46
	public String fofoFormJson(){
47
		//return new JSONObject(this.fofoForm()).toString();
48
		return new Gson().toJson(this.fofoForm());
49
	}
50
 
51
	public List<FofoForm> getLatestFofo() {
52
		return Mongo.getFofoForms(0, 10);
53
	}
54
 
55
	private String getUrlFromDocumentPath(String documentName, String documentPath) {
56
		if(DOCUMENT_NAMES.contains(documentPath)) {
57
			return documentPath;	
58
		}
59
		return documentPath;
60
 
61
	}
62
}