package com.qs.mp.web.controller.common;

import com.qs.mp.web.controller.BaseController;
import java.util.List;

/**
 * 
 * 开放API基类
 * 
 * @author duota
 *
 */
public class BaseApiController extends BaseController {

	  /**
     * 全部数据权限
     */
    public static final String DATA_SCOPE_ALL = "1";

    /**
     * 自定数据权限
     */
    public static final String DATA_SCOPE_CUSTOM = "2";

    /**
     * 数据权限过滤关键字
     */
    public static final String DATA_SCOPE = "dataScope";
    
    public static String listToString(List<String> list) {
        StringBuilder sb = new StringBuilder();
        if (list != null && list.size() > 0) {
            for (int i = 0; i < list.size(); i++) {
                if (i < list.size() - 1) {
                    sb.append("'"+list.get(i) + "',");
                } else {
                    sb.append("'"+list.get(i)+"'");
                }
            }
        }
        return sb.toString();
    }
}

