text:
package me.dkzwm.widget.srl.sample.ui;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
import me.dkzwm.widget.srl.HorizontalSmoothRefreshLayout;
import me.dkzwm.widget.srl.RefreshingListenerAdapter;
import me.dkzwm.widget.srl.extra.footer.MaterialFooter;
import me.dkzwm.widget.srl.extra.header.MaterialHeader;
import me.dkzwm.widget.srl.sample.R;
import me.dkzwm.widget.srl.sample.adapter.HorizontalRecyclerViewAdapter;
import me.dkzwm.widget.srl.sample.utils.DataUtil;
import me.dkzwm.widget.srl.util.PixelUtl;

/**
 * Created by dkzwm on 2017/6/1.
 *
 * @author dkzwm
 */
public class TestHorizontalRecyclerViewActivity extends AppCompatActivity {
    private HorizontalSmoothRefreshLayout mRefreshLayout;
    private RecyclerView mRecyclerView;
    private HorizontalRecyclerViewAdapter mAdapter;
    private Handler mHandler = new Handler();
    private int mCount = 0;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_with_horizontal_recyclerview);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setTitle(R.string.test_horizontal_recyclerView);
        mRecyclerView = findViewById(R.id.recyclerView_with_horizontal_recyclerView);
        mRecyclerView.setLayoutManager(
                new GridLayoutManager(this, 3, LinearLayoutManager.HORIZONTAL, false));
        mRecyclerView.setHasFixedSize(true);
        mAdapter = new HorizontalRecyclerViewAdapter(this, getLayoutInflater());
        mRecyclerView.setAdapter(mAdapter);
        mRefreshLayout = findViewById(R.id.smoothRefreshLayout_with_horizontal_recyclerView);
        MaterialHeader header = new MaterialHeader(this);
        header.setColorSchemeColors(new int[] {Color.RED, Color.BLUE, Color.GREEN, Color.BLACK});
        header.setPadding(PixelUtl.dp2px(this, 25), 0, PixelUtl.dp2px(this, 25), 0);
        mRefreshLayout.setHeaderView(header);
        MaterialFooter footer = new MaterialFooter(this);
        footer.setProgressBarColors(new int[] {Color.RED, Color.BLUE, Color.GREEN, Color.BLACK});
        mRefreshLayout.setFooterView(footer);
        mRefreshLayout.setDisableLoadMore(false);
        mRefreshLayout.setEnableAutoLoadMore(true);
        mRefreshLayout.setEnablePinContentView(true);
        mRefreshLayout.setEnablePinRefreshViewWhileLoading(true);
        mRefreshLayout.setOnRefreshListener(
                new RefreshingListenerAdapter() {
                    @Override
                    public void onRefreshing() {
                        mHandler.postDelayed(
                                new Runnable() {
                                    @Override
                                    public void run() {
                                        List<String> list = DataUtil.createList(mCount, 20);
                                        mCount = list.size();
                                        mAdapter.updateData(list);
                                        mRefreshLayout.refreshComplete();
                                    }
                                },
                                3000);
                    }

                    @Override
                    public void onLoadingMore() {
                        Toast.makeText(
                                        TestHorizontalRecyclerViewActivity.this,
                                        R.string.has_been_triggered_to_load_more,
                                        Toast.LENGTH_SHORT)
                                .show();
                        mHandler.postDelayed(
                                new Runnable() {
                                    @Override
                                    public void run() {
                                        List<String> list = DataUtil.createList(mCount, 20);
                                        mCount += list.size();
                                        mAdapter.appendData(list);
                                        mRefreshLayout.refreshComplete();
                                    }
                                },
                                3000);
                    }
                });
        mRefreshLayout.setDurationToClose(800);
        mRefreshLayout.autoRefresh(false);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                onBackPressed();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public void onBackPressed() {
        startActivity(new Intent(TestHorizontalRecyclerViewActivity.this, MainActivity.class));
        finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mHandler.removeCallbacksAndMessages(null);
    }
}


text:
from common_fixtures import *  # NOQA

# test that admin_client can list accounts
# (parent of project which has just been created)
def test_list_account(client):
    client.list_account()

def test_schema_includeable_links(client):
    schema = client.schema.types['service']
    assert 'serviceLogs' in schema.includeableLinks

redpajama_set_name: RedPajamaGithub


text:
ActiveRecord::Schema.define(version: 20160322002449) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

  create_table "categories", force: :cascade do |t|
    t.integer "parent_id"
    t.string  "name"
    t.string  "description"
  end

  create_table "categorized_posts", force: :cascade do |t|
    t.integer "category_id"
    t.integer "post_id"
  end

  add_index "categorized_posts", ["category_id"], name: "index_categorized_posts_on_category_id", using: :btree
  add_index "categorized_posts", ["post_id"], name: "index_categorized_posts_on_post_id", using: :btree

  create_table "posts", force: :cascade do |t|
    t.integer  "status",        default: 0
    t.integer  "kind",          default: 0
    t.string   "title"
    t.string   "slug"
    t.text     "excerpt"
    t.text     "more_text"
    t.text     "body"
    t.json     "custom_fields"
    t.datetime "created_at",                null: false
    t.datetime "updated_at",                null: false
  end

  add_index "posts", ["kind"], name: "index_posts_on_kind", using: :btree
  add_index "posts", ["status"], name: "index_posts_on_status", using: :btree

  create_table "uploads", force: :cascade do |t|
    t.string  "name"
    t.string  "mime_type"
    t.integer "size"
    t.string  "dropbox_url"
    t.string  "dropbox_id"
    t.string  "dropbox_path"
    t.string  "dropbox_rev"
  end

  add_index "uploads", ["dropbox_id"], name: "index_uploads_on_dropbox_id", unique: true, using: :btree
  add_index "uploads", ["dropbox_url"], name: "index_uploads_on_dropbox_url", using: :btree

end


text:
Ohai::Config[:plugin_path] << node['vagrant-ohai']['plugin_path']
Chef::Log.info("vagrant ohai plugins will be at: #{node['vagrant-ohai']['plugin_path']}")

rd = remote_directory node['vagrant-ohai']['plugin_path'] do
  source 'plugins'
  owner 'root'
  group 'root'
  mode 0755
  recursive true
  action :nothing
end

rd.run_action(:create)

# only reload ohai if new plugins were dropped off OR
# node['vagrant-ohai']['plugin_path'] does not exists in client.rb
if rd.updated? ||
  !(::IO.read(Chef::Config[:config_file]) =~ /Ohai::Config\[:plugin_path\]\s*<<\s*["']#{node['vagrant-ohai']['plugin_path']}["']/)

  ohai 'custom_plugins' do
    action :nothing
  end.run_action(:reload)

end

# Vagrant host only fix end

install_flag = "/root/.galera_cluster_installed"

galera_config = data_bag_item('sql_galera_cluster', 'config')
mysql_tarball = galera_config['mysql_wsrep_tarball_' + node['kernel']['machine']]
# strip .tar.gz
mysql_package = mysql_tarball[0..-8]

mysql_wsrep_source = galera_config['mysql_wsrep_source']
galera_source = galera_config['galera_source']

# MySQL and Galera setup and configuration

# Create MySQL group and user
group "mysql" do
end

user "mysql" do
  gid "mysql"
  comment "MySQL server"
  system true
  shell "/bin/false"
end

# Download MySQL Source package
Chef::Log.info "Downloading #{mysql_tarball}"
remote_file "#{Chef::Config[:file_cache_path]}/#{mysql_tarball}" do
  source "#{mysql_wsrep_source}/" + mysql_tarball
  action :create_if_missing
end

# Determine the correct Galera source to download
case node['platform']
when 'centos', 'redhat', 'fedora', 'suse', 'scientific', 'amazon'
  galera_package = galera_config['galera_package_' + node['kernel']['machine']]['rpm']
else
  galera_package = galera_config['galera_package_' + node['kernel']['machine']]['deb']
end

# Download the source package determined from above
Chef::Log.info "Downloading #{galera_package}"
remote_file "#{Chef::Config[:file_cache_path]}/#{galera_package}" do
  source "#{galera_source}/" + galera_package
  action :create_if_missing
end

# ????
bash "install-mysql-package" do
  user "root"
  code <<-EOH
    zcat #{Chef::Config[:file_cache_path]}/#{mysql_tarball} | tar xf - -C #{node['mysql']['install_dir']}
    ln -sf #{node['mysql']['install_dir']}/#{mysql_package} #{node['mysql']['base_dir']}
  EOH
  not_if { File.directory?("#{node['mysql']['install_dir']}/#{mysql_package}") }
end

# Ensure and existing MySQL packages are purged from the system
case node['platform']
  when 'centos', 'redhat', 'fedora', 'suse', 'scientific', 'amazon'
    bash "purge-mysql-galera" do
      user "root"
      code <<-EOH
        killall -9 mysqld_safe mysqld &> /dev/null
        yum remove mysql mysql-libs mysql-devel mysql-server mysql-bench
        cd #{node['mysql']['data_dir']}
        [ $? -eq 0 ] && rm -rf #{node['mysql']['data_dir']}/*
        rm -rf /etc/my.cnf /etc/mysql
        rm -f /root/#{install_flag}
      EOH
      only_if { !FileTest.exists?("#{install_flag}") }
    end
  else
    bash "purge-mysql-galera" do
      user "root"
      code <<-EOH
        killall -9 mysqld_safe mysqld &> /dev/null
        apt-get -y remove --purge mysql-server mysql-client mysql-common
        apt-get -y autoremove
        apt-get -y autoclean
        cd #{node['mysql']['data_dir']}
        [ $? -eq 0 ] && rm -rf #{node['mysql']['data_dir']}/*
        rm -rf /etc/my.cnf /etc/mysql
        rm -f /root/#{install_flag}
      EOH
      only_if { !FileTest.exists?("#{install_flag}") }
    end
end

# Install extra packages and the galera package already downloaded
case node['platform']
when 'centos', 'redhat', 'fedora', 'suse', 'scientific', 'amazon'
  bash "install-galera" do
    user "root"
    code <<-EOH
      yum -y localinstall #{node['xtra']['packages']}
      yum -y localinstall #{Chef::Config[:file_cache_path]}/#{galera_package}
    EOH
    not_if { FileTest.exists?("#{node['wsrep']['provider']}") }
  end
else
  bash "install-galera" do
    user "root"
    code <<-EOH
      apt-get -y --force-yes install #{node['xtra']['packages']}
      dpkg -i #{Chef::Config[:file_cache_path]}/#{galera_package}
      apt-get -f install
    EOH
    not_if { FileTest.exists?("#{node['wsrep']['provider']}") }
  end
end

# Create directories for MySQL
directory node['mysql']['data_dir'] do
  owner "mysql"
  group "mysql"
  mode "0755"
  action :create
  recursive true
end

directory node['mysql']['run_dir'] do
  owner "mysql"
  group "mysql"
  mode "0755"
  action :create
  recursive true
end

# Install db to the data directory
execute "setup-mysql-datadir" do
  command "#{node['mysql']['base_dir']}/scripts/mysql_install_db --force --user=mysql --basedir=#{node['mysql']['base_dir']} --datadir=#{node['mysql']['data_dir']}"
  not_if { FileTest.exists?("#{node['mysql']['data_dir']}/mysql/user.frm") }
end

# Copy init script to manage the SQL service
execute "setup-init.d-mysql-service" do
  command "cp #{node['mysql']['base_dir']}/support-files/mysql.server /etc/init.d/#{node['mysql']['servicename']}"
  not_if { FileTest.exists?("#{install_flag}") }
end

# Ensure my.conf file is correctly configured
template "my.cnf" do
  path "#{node['mysql']['conf_dir']}/my.cnf"
  source "my.cnf.erb"
  owner "mysql"
  group "mysql"
  mode "0644"
#  notifies :restart, "service[mysql]", :delayed
end

# Bootstrapping and managing cluster

my_ip = node['ipaddress']
init_host = galera_config['init_node']
sync_host = init_host

# Try to sync with a random node in the cluster, falling back the the init host
hosts = galera_config['galera_nodes']
Chef::Log.info "init_host = #{init_host}, my_ip = #{my_ip}, hosts = #{hosts}"
if File.exists?("#{install_flag}") && hosts != nil && hosts.length > 0
  i = 0
  begin
    sync_host = hosts[rand(hosts.count)]
    i += 1
    if (i > hosts.count)
      # no host found, use init node/host
      sync_host = init_host
      break
    end
  end while my_ip == sync_host
end

# Update the address of the members of the cluster in the my.cnf file
wsrep_cluster_address = 'gcomm://'
if !File.exists?("#{install_flag}") && hosts != nil && hosts.length > 0
  hosts.each do |h|
    wsrep_cluster_address += "#{h}:#{node['wsrep']['port']},"
  end
  wsrep_cluster_address = wsrep_cluster_address[0..-2]
end

Chef::Log.info "wsrep_cluster_address = #{wsrep_cluster_address}"
bash "set-wsrep-cluster-address" do
  user "root"
  code <<-EOH
  sed -i 's#.*wsrep_cluster_address.*=.*#wsrep_cluster_address=#{wsrep_cluster_address}#' #{node['mysql']['conf_dir']}/my.cnf
  EOH
  only_if { (galera_config['update_wsrep_urls'] == 'yes') || !FileTest.exists?("#{install_flag}") }
end

# If we are the init node then we need to start the cluster
service "init-cluster" do
  service_name node['mysql']['servicename']
  supports :start => true
  start_command "service #{node['mysql']['servicename']} start --wsrep-cluster-address=gcomm://"
  action [:enable, :start]
  only_if { my_ip == init_host && !FileTest.exists?("#{install_flag}") }
end

# Sleep to ensure the init host is dont with its Chef run incase we are provisioning a whole custer at once
if my_ip != init_host && !File.exists?("#{install_flag}")
Chef::Log.info "Joiner node sleeping 30 seconds to make sure donor node is up..."
sleep(node['xtra']['sleep'])
Chef::Log.info "Joiner node cluster address = gcomm://#{sync_host}:#{node['wsrep']['port']}"
end

# Start MySQL service
service "join-cluster" do
  service_name node['mysql']['servicename']
  supports :restart => true, :start => true, :stop => true
  action [:enable, :start]
  only_if { my_ip != init_host && !FileTest.exists?("#{install_flag}") }
end

# Ensure we have joined the cluster and wait until the sync is complete
bash "wait-until-synced" do
  user "root"
  code <<-EOH
    state=0
    cnt=0
    until [[ "$state" == "4" || "$cnt" > 5 ]]
    do
      state=$(#{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "SET wsrep_on=0; SHOW GLOBAL STATUS LIKE 'wsrep_local_state'")
      state=$(echo "$state"  | tr '\n' ' ' | awk '{print $4}')
      cnt=$(($cnt + 1))
      sleep 1
    done
  EOH
  only_if { my_ip == init_host && !FileTest.exists?("#{install_flag}") }
end

# Ensure the wresp user has approiate permissions
bash "set-wsrep-grants-mysqldump" do
  user "root"
  code <<-EOH
    #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "GRANT ALL ON *.* TO '#{node['wsrep']['user']}'@'%' IDENTIFIED BY '#{node['wsrep']['password']}'"
    #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "SET wsrep_on=0; GRANT ALL ON *.* TO '#{node['wsrep']['user']}'@'127.0.0.1' IDENTIFIED BY '#{node['wsrep']['password']}'"
  EOH
  only_if { my_ip == init_host && (galera_config['sst_method'] == 'mysqldump') && !FileTest.exists?("#{install_flag}") }
end

# Help secure the default MySQL installation
bash "secure-mysql" do
  user "root"
  code <<-EOH
    #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "DROP DATABASE IF EXISTS test; DELETE FROM mysql.db WHERE DB='test' OR DB='test\\_%'"
    #{node['mysql']['mysql_bin']} -uroot -h127.0.0.1 -e "UPDATE mysql.user SET Password=PASSWORD('#{node['mysql']['root_password']}') WHERE User='root'; DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); FLUSH PRIVILEGES;"
  EOH
  only_if { my_ip == init_host && (galera_config['secure'] == 'yes') && !FileTest.exists?("#{install_flag}") }
end

# Ensure the MySQL server service is managed
service "mysql" do
  supports :restart => true, :start => true, :stop => true
  service_name node['mysql']['servicename']
  action :nothing
  only_if { FileTest.exists?("#{install_flag}") }
end

execute "galera-cluster-installed" do
  command "touch #{install_flag}"
  action :run
  not_if { FileTest.exists?("#{install_flag}") }
end


text:
package com.java110.common.smo.impl;

import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.dto.PageDto;
import com.java110.dto.allocationStorehouseApply.AllocationStorehouseApplyDto;
import com.java110.dto.businessDatabus.CustomBusinessDatabusDto;
import com.java110.dto.purchaseApply.PurchaseApplyDto;
import com.java110.dto.storehouse.StorehouseDto;
import com.java110.dto.workflow.WorkflowDto;
import com.java110.entity.audit.AuditUser;
import com.java110.intf.common.IAllocationStorehouseUserInnerServiceSMO;
import com.java110.intf.common.IWorkflowInnerServiceSMO;
import com.java110.intf.job.IDataBusInnerServiceSMO;
import com.java110.intf.store.IAllocationStorehouseApplyInnerServiceSMO;
import com.java110.intf.store.IPurchaseApplyInnerServiceSMO;
import com.java110.intf.store.IStorehouseInnerServiceSMO;
import com.java110.po.machine.MachineRecordPo;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
import org.activiti.engine.HistoryService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricTaskInstance;
import org.activiti.engine.history.HistoricTaskInstanceQuery;
import org.activiti.engine.impl.identity.Authentication;
import org.activiti.engine.query.Query;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.java110.dto.storehouse.StorehouseDto.SH_TYPE_GROUP;

//@Service("resourceEntryStoreSMOImpl")
@RestController
public class AllocationStorehouseUserInnerServiceSMOImpl extends BaseServiceSMO implements IAllocationStorehouseUserInnerServiceSMO {

    @Autowired
    private ProcessEngine processEngine;

    @Autowired
    private RuntimeService runtimeService;

    @Autowired
    private IAllocationStorehouseApplyInnerServiceSMO allocationStorehouseApplyInnerServiceSMOImpl;

    @Autowired
    private IWorkflowInnerServiceSMO workflowInnerServiceSMOImpl;

    @Autowired
    private IPurchaseApplyInnerServiceSMO purchaseApplyInnerServiceSMOImpl;

    @Autowired
    private IDataBusInnerServiceSMO dataBusInnerServiceSMOImpl;

    @Autowired
    private IStorehouseInnerServiceSMO iStorehouseInnerServiceSMO;

    /**
     * 启动流程
     *
     * @return
     */
    public AllocationStorehouseApplyDto startProcess(@RequestBody AllocationStorehouseApplyDto allocationStorehouseApplyDto) {
        //将信息加入map,以便传入流程中
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("allocationStorehouseApplyDto", allocationStorehouseApplyDto);
        variables.put("userId", allocationStorehouseApplyDto.getCurrentUserId());
        variables.put("startUserId", allocationStorehouseApplyDto.getCurrentUserId());
        variables.put("nextUserId", allocationStorehouseApplyDto.getNextUserId());
        //查询调拨源仓库是集团仓库还是小区仓库,小区仓库走被调拨流程审批
        StorehouseDto storehouseDto = new StorehouseDto();
        storehouseDto.setShId(allocationStorehouseApplyDto.getShId());
        List<StorehouseDto> storehouseDtoList = iStorehouseInnerServiceSMO.queryStorehouses(storehouseDto);
        StorehouseDto storehouseDto1 = new StorehouseDto();
        String communityId = null;
        if (storehouseDtoList != null && storehouseDtoList.size() > 0) {
            storehouseDto1 = storehouseDtoList.get(0);
        }
        if (SH_TYPE_GROUP.equals(storehouseDto1.getShType())) {//集团仓库
            communityId = "9999";
        } else {//小区仓库
            communityId = storehouseDto1.getShObjId();
        }
        //开启流程
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(getWorkflowDto(allocationStorehouseApplyDto.getStoreId(), communityId), allocationStorehouseApplyDto.getApplyId(), variables);
        //将得到的实例流程id值赋给之前设置的变量
        String processInstanceId = processInstance.getId();
        // System.out.println("流程开启成功.......实例流程id:" + processInstanceId);
        String processDefinitionId = processInstance.getProcessDefinitionId();
        String businessKey = processInstance.getBusinessKey();
        //获取下级处理人id
        PurchaseApplyDto purchaseDto = new PurchaseApplyDto();
        purchaseDto.setActRuTaskId(processInstanceId);
        purchaseDto.setProcDefId(processDefinitionId);
        purchaseDto.setBusinessKey(businessKey);
        List<PurchaseApplyDto> actRuTaskUserIds = purchaseApplyInnerServiceSMOImpl.getActRuTaskUserId(purchaseDto);
        allocationStorehouseApplyDto.setProcessInstanceId(processInstanceId);
        if (actRuTaskUserIds != null && actRuTaskUserIds.size() > 0) {
            for (PurchaseApplyDto purchaseApply : actRuTaskUserIds) {
                String actRuTaskUserId = purchaseApply.getTaskUserId();
                MachineRecordPo machineRecordPo = new MachineRecordPo();
                machineRecordPo.setApplyOrderId(businessKey);
                machineRecordPo.setPurchaseUserId(actRuTaskUserId);
                //传送databus
                dataBusInnerServiceSMOImpl.customExchange(CustomBusinessDatabusDto.getInstance(
                        BusinessTypeConstant.BUSINESS_TYPE_DATABUS_ALLOCATION_STOREHOUSE_APPLY, BeanConvertUtil.beanCovertJson(machineRecordPo)));
            }
        }
        return allocationStorehouseApplyDto;
    }

    /**
     * 查询用户任务数
     *
     * @param user
     * @return
     */
    public long getUserTaskCount(@RequestBody AuditUser user) {
        TaskService taskService = processEngine.getTaskService();
        List<String> workflowlist = getWorkflowDto1(user.getStoreId());
        TaskQuery query = taskService.createTaskQuery().processDefinitionKeyIn(workflowlist);
//        TaskQuery query = taskService.createTaskQuery().processDefinitionKey(getWorkflowDto(user.getStoreId(), user.getCommunityId()));
        query.taskAssignee(user.getUserId());
        return query.count();
    }

    /**
     * 获取用户任务
     *
     * @param user 用户信息
     */
    public List<AllocationStorehouseApplyDto> getUserTasks(@RequestBody AuditUser user) {
        TaskService taskService = processEngine.getTaskService();
        TaskQuery query = taskService.createTaskQuery().processDefinitionKeyIn(getWorkflowDto1(user.getStoreId()));
        query.taskAssignee(user.getUserId());
        query.orderByTaskCreateTime().desc();
        List<Task> list = null;
        if (user.getPage() >= 1) {
            user.setPage((user.getPage() - 1) * user.getRow());
        }
        if (user.getPage() != PageDto.DEFAULT_PAGE) {
            list = query.listPage(user.getPage(), user.getRow());
        } else {
            list = query.list();
        }

        List<String> appIyIds = new ArrayList<>();
        Map<String, String> taskBusinessKeyMap = new HashMap<>();
        for (Task task : list) {
            String processInstanceId = task.getProcessInstanceId();
            //3.使用流程实例,查询
            ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
            //4.使用流程实例对象获取BusinessKey
            String business_key = pi.getBusinessKey();
            appIyIds.add(business_key);
            taskBusinessKeyMap.put(business_key, task.getId());
        }

        if (appIyIds == null || appIyIds.size() == 0) {
            return new ArrayList<>();
        }

        //查询 投诉信息
        AllocationStorehouseApplyDto allocationStorehouseApplyDto = new AllocationStorehouseApplyDto();
        allocationStorehouseApplyDto.setStoreId(user.getStoreId());
        allocationStorehouseApplyDto.setApplyIds(appIyIds.toArray(new String[appIyIds.size()]));
        List<AllocationStorehouseApplyDto> tmpAllocationStorehouseApplyDtos = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplys(allocationStorehouseApplyDto);
        for (AllocationStorehouseApplyDto tmpAllocationStorehouseApplyDto : tmpAllocationStorehouseApplyDtos) {
            tmpAllocationStorehouseApplyDto.setTaskId(taskBusinessKeyMap.get(tmpAllocationStorehouseApplyDto.getApplyId()));
        }
        return tmpAllocationStorehouseApplyDtos;
    }

    public boolean agreeCompleteTask(@RequestBody AllocationStorehouseApplyDto allocationStorehouseApplyDto) {
        TaskService taskService = processEngine.getTaskService();
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("auditCode", allocationStorehouseApplyDto.getAuditCode());
        taskService.complete(allocationStorehouseApplyDto.getTaskId(), variables);
        return true;
    }

    public boolean refuteCompleteTask(@RequestBody AllocationStorehouseApplyDto allocationStorehouseApplyDto) {
        TaskService taskService = processEngine.getTaskService();
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("auditCode", allocationStorehouseApplyDto.getAuditCode());
        taskService.complete(allocationStorehouseApplyDto.getTaskId(), variables);
        return true;
    }

    /**
     * 审核 当前任务
     *
     * @param allocationStorehouseApplyDto 资源订单
     * @return
     */
    public boolean complete(@RequestBody AllocationStorehouseApplyDto allocationStorehouseApplyDto) {
        TaskService taskService = processEngine.getTaskService();

        taskService.complete(allocationStorehouseApplyDto.getTaskId());

        return true;
    }

    private String getWorkflowDto(String storeId, String communityId) {
        //开启流程
        //WorkflowDto.DEFAULT_PROCESS + workflowDto.getFlowId()
        WorkflowDto workflowDto = new WorkflowDto();
        if (!StringUtil.isEmpty(communityId) && "9999".equals(communityId)) {
            workflowDto.setFlowType(WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE);
        } else {
            workflowDto.setFlowType(WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE_GO);
        }
        workflowDto.setStoreId(storeId);
        workflowDto.setCommunityId(communityId);
        List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
        Assert.listOnlyOne(workflowDtos, "未找到 调拨流程或找到多条,请在物业账号系统管理下流程管理中配置流程");
        WorkflowDto tmpWorkflowDto = workflowDtos.get(0);
        if (StringUtil.isEmpty(tmpWorkflowDto.getProcessDefinitionKey())) {
            throw new IllegalArgumentException("调拨流程流程还未部署");
        }
        return WorkflowDto.DEFAULT_PROCESS + tmpWorkflowDto.getFlowId();
    }

    private List<String> getWorkflowDto1(String storeId) {

        //开启流程
        //WorkflowDto.DEFAULT_PROCESS + workflowDto.getFlowId()
        WorkflowDto workflowDto = new WorkflowDto();
        String[] flowTypes = new String[]{WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE, WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE_GO};
        workflowDto.setFlowTypes(flowTypes);
        workflowDto.setStoreId(storeId);
        List<WorkflowDto> workflowDtos = workflowInnerServiceSMOImpl.queryWorkflows(workflowDto);
        if (workflowDtos != null && workflowDtos.size() == 0) {
            throw new IllegalArgumentException("未找到 调拨流程,请在物业账号系统管理下流程管理中配置流程!");
        }
        List<String> flowIdList = new ArrayList<String>();
        for (WorkflowDto workflowDto1 : workflowDtos) {
            if (StringUtil.isEmpty(workflowDto1.getProcessDefinitionKey()) && WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE.equals(workflowDto1.getFlowType())) {
                throw new IllegalArgumentException("小区编码=" + workflowDto1.getCommunityId() + "的物品调拨流程还未部署");
            }
            if (StringUtil.isEmpty(workflowDto1.getProcessDefinitionKey()) && WorkflowDto.FLOW_TYPE_ALLOCATION_STOREHOUSE_GO.equals(workflowDto1.getFlowType())) {
                throw new IllegalArgumentException("小区编码=" + workflowDto1.getCommunityId() + "的物品被调拨还未部署");
            }
            flowIdList.add(WorkflowDto.DEFAULT_PROCESS + workflowDto1.getFlowId());
        }
        return flowIdList;
    }

    /**
     * 查询用户任务数
     *
     * @param user
     * @return
     */
    public long getUserHistoryTaskCount(@RequestBody AuditUser user) {
        HistoryService historyService = processEngine.getHistoryService();
//        Query query = historyService.createHistoricTaskInstanceQuery()
//                .processDefinitionKey("complaint")
//                .taskAssignee(user.getUserId());

        HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
                .processDefinitionKeyIn(getWorkflowDto1(user.getStoreId()))
                .taskAssignee(user.getUserId())
                .finished();
        if (!StringUtil.isEmpty(user.getAuditLink()) && "START".equals(user.getAuditLink())) {
            historicTaskInstanceQuery.taskName("complaint");
        } else if (!StringUtil.isEmpty(user.getAuditLink()) && "AUDIT".equals(user.getAuditLink())) {
            historicTaskInstanceQuery.taskName("complaitDealUser");
        }

        Query query = historicTaskInstanceQuery;
        return query.count();
    }

    /**
     * 获取用户审批的任务
     *
     * @param user 用户信息
     */
    public List<AllocationStorehouseApplyDto> getUserHistoryTasks(@RequestBody AuditUser user) {
        HistoryService historyService = processEngine.getHistoryService();

        HistoricTaskInstanceQuery historicTaskInstanceQuery = historyService.createHistoricTaskInstanceQuery()
                .processDefinitionKeyIn(getWorkflowDto1(user.getStoreId()))
                .taskAssignee(user.getUserId())
                .finished();
//        if (!StringUtil.isEmpty(user.getAuditLink()) && "START".equals(user.getAuditLink())) {
//            historicTaskInstanceQuery.taskName("complaint");
//        } else if (!StringUtil.isEmpty(user.getAuditLink()) && "AUDIT".equals(user.getAuditLink())) {
//            historicTaskInstanceQuery.taskName("complaitDealUser");
//        }

        Query query = historicTaskInstanceQuery.orderByHistoricTaskInstanceStartTime().desc();

        List<HistoricTaskInstance> list = null;
        if (user.getPage() != PageDto.DEFAULT_PAGE) {
            list = query.listPage((user.getPage() - 1) * user.getRow(), user.getRow());
        } else {
            list = query.list();
        }

        List<String> appIyIds = new ArrayList<>();
        Map<String, String> taskBusinessKeyMap = new HashMap<>();

        for (HistoricTaskInstance task : list) {
            String processInstanceId = task.getProcessInstanceId();
            //3.使用流程实例,查询
            HistoricProcessInstance pi = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
            //4.使用流程实例对象获取BusinessKey
            String business_key = pi.getBusinessKey();
            appIyIds.add(business_key);
            taskBusinessKeyMap.put(business_key, task.getId());
        }

        //查询 投诉信息
        AllocationStorehouseApplyDto allocationStorehouseApplyDto = new AllocationStorehouseApplyDto();
        allocationStorehouseApplyDto.setStoreId(user.getStoreId());
        allocationStorehouseApplyDto.setApplyIds(appIyIds.toArray(new String[appIyIds.size()]));
        List<AllocationStorehouseApplyDto> tmpAllocationStorehouseApplyDtos = allocationStorehouseApplyInnerServiceSMOImpl.queryAllocationStorehouseApplys(allocationStorehouseApplyDto);

        for (AllocationStorehouseApplyDto tmpAllocationStorehouseApplyDto : tmpAllocationStorehouseApplyDtos) {
            tmpAllocationStorehouseApplyDto.setTaskId(taskBusinessKeyMap.get(tmpAllocationStorehouseApplyDto.getApplyId()));
        }
        return tmpAllocationStorehouseApplyDtos;
    }

    public boolean completeTask(@RequestBody AllocationStorehouseApplyDto allocationStorehouseApplyDto) {
        //获取状态标识
        String noticeState = allocationStorehouseApplyDto.getNoticeState();
        //获取审批状态
        String auditCode = allocationStorehouseApplyDto.getAuditCode();
        //获取拒绝理由
        String auditMessage = "";
        if (!StringUtil.isEmpty(auditCode) && auditCode.equals("1200")) {
            auditMessage = allocationStorehouseApplyDto.getAuditMessage();
        }
        TaskService taskService = processEngine.getTaskService();
        Task task = taskService.createTaskQuery().taskId(allocationStorehouseApplyDto.getTaskId()).singleResult();
        String processInstanceId = task.getProcessInstanceId();
        Authentication.setAuthenticatedUserId(allocationStorehouseApplyDto.getCurrentUserId());
        taskService.addComment(allocationStorehouseApplyDto.getTaskId(), processInstanceId, allocationStorehouseApplyDto.getAuditMessage());
        Map<String, Object> variables = new HashMap<String, Object>();
        variables.put("auditCode", allocationStorehouseApplyDto.getAuditCode());
        variables.put("currentUserId", allocationStorehouseApplyDto.getCurrentUserId());
        variables.put("flag", "1200".equals(allocationStorehouseApplyDto.getAuditCode()) ? "false" : "true");
        variables.put("startUserId", allocationStorehouseApplyDto.getStartUserId());
        taskService.complete(allocationStorehouseApplyDto.getTaskId(), variables);
        ProcessInstance pi = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
        if (pi == null) {
            return true;
        }
        String rootProcessInstanceId = pi.getId();
        String processDefinitionId = pi.getProcessDefinitionId();
        String businessKey = pi.getBusinessKey();
        //获取下级处理人id
        PurchaseApplyDto purchaseDto = new PurchaseApplyDto();
        purchaseDto.setActRuTaskId(rootProcessInstanceId);
        purchaseDto.setProcDefId(processDefinitionId);
        purchaseDto.setBusinessKey(businessKey);
        List<PurchaseApplyDto> actRuTaskUserIds = purchaseApplyInnerServiceSMOImpl.getActRuTaskUserId(purchaseDto);
        if (actRuTaskUserIds != null && actRuTaskUserIds.size() > 0) {
            for (PurchaseApplyDto purchaseApply : actRuTaskUserIds) {
                String actRuTaskUserId = purchaseApply.getTaskUserId();
                MachineRecordPo machineRecordPo = new MachineRecordPo();
                machineRecordPo.setApplyOrderId(businessKey);
                machineRecordPo.setPurchaseUserId(actRuTaskUserId);
                machineRecordPo.setNoticeState(noticeState);
                machineRecordPo.setAuditMessage(auditMessage);
                //传送databus
                dataBusInnerServiceSMOImpl.customExchange(CustomBusinessDatabusDto.getInstance(
                        BusinessTypeConstant.BUSINESS_TYPE_DATABUS_ALLOCATION_STOREHOUSE_APPLY, BeanConvertUtil.beanCovertJson(machineRecordPo)));
            }
        }
        return false;
    }

}


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM.IEC61968.Assets;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61968.Work;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfAssets;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfCommon;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfGMLSupport;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfLocations;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfOperations;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfTypeAsset;

namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.InfWork
{

    public class DesignLocationMiscCostItemsCollection : ObservableOppositeOrderedSet<IDesignLocation, IMiscCostItem>
    {

        public DesignLocationMiscCostItemsCollection(IDesignLocation parent) :
                base(parent)
        {
        }

        private void OnItemDeleted(object sender, System.EventArgs e)
        {
            this.Remove(((IMiscCostItem)(sender)));
        }

        protected override void SetOpposite(IMiscCostItem item, IDesignLocation parent)
        {
            if ((parent != null))
            {
                item.Deleted += this.OnItemDeleted;
                item.DesignLocation = parent;
            }
            else
            {
                item.Deleted -= this.OnItemDeleted;
                if ((item.DesignLocation == this.Parent))
                {
                    item.DesignLocation = parent;
                }
            }
        }
    }
}


text:
namespace Entity.Model
{
    using System;
    using System.Collections.Generic;

    public partial class DNK_XML
    {
        public System.DateTime DNKXML_DATE { get; set; }
        public int DNKXML_PARTNER { get; set; }
        public string DNKXML_PARM1 { get; set; }
        public string DNKXML_PARM2 { get; set; }
        public bool DNKXML_ACTIVE { get; set; }
        public int ID { get; set; }
        public Nullable<double> DNKXML_ExtraChargeValue { get; set; }
        public Nullable<bool> DNKXML_ExtraChargeIsPercent { get; set; }
    }
}


text:
package org.hildan.livedoc.core;

import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import org.hildan.livedoc.core.annotations.Api;
import org.hildan.livedoc.core.annotations.ApiHeader;
import org.hildan.livedoc.core.annotations.ApiHeaders;
import org.hildan.livedoc.core.annotations.ApiOperation;
import org.hildan.livedoc.core.annotations.ApiParams;
import org.hildan.livedoc.core.annotations.ApiPathParam;
import org.hildan.livedoc.core.annotations.ApiQueryParam;
import org.hildan.livedoc.core.annotations.ApiRequestBodyType;
import org.hildan.livedoc.core.annotations.ApiResponseBodyType;
import org.hildan.livedoc.core.annotations.ApiStage;
import org.hildan.livedoc.core.annotations.ApiVersion;
import org.hildan.livedoc.core.annotations.auth.ApiAuthBasic;
import org.hildan.livedoc.core.annotations.auth.ApiAuthBasicUser;
import org.hildan.livedoc.core.annotations.auth.ApiAuthNone;
import org.hildan.livedoc.core.annotations.auth.ApiAuthToken;
import org.hildan.livedoc.core.config.LivedocConfiguration;
import org.hildan.livedoc.core.model.doc.ApiDoc;
import org.hildan.livedoc.core.model.doc.ApiErrorDoc;
import org.hildan.livedoc.core.model.doc.ApiOperationDoc;
import org.hildan.livedoc.core.model.doc.ApiVerb;
import org.hildan.livedoc.core.model.doc.AuthType;
import org.hildan.livedoc.core.model.doc.ParamDoc;
import org.hildan.livedoc.core.model.doc.Stage;
import org.hildan.livedoc.core.readers.annotation.ApiAuthDocReader;
import org.hildan.livedoc.core.test.controller.Test3Controller;
import org.hildan.livedoc.core.test.pojo.Child;
import org.hildan.livedoc.core.test.pojo.Pizza;
import org.junit.Assert;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class ApiDocTest {

    @SuppressWarnings("unused")
    @Api(name = "test-controller", description = "a-test-controller")
    @ApiVersion(since = "1.0", until = "2.12")
    @ApiAuthNone
    private class TestController {

        @ApiOperation(path = "/name", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public String name(@ApiPathParam(name = "name") String name, @ApiRequestBodyType String body) {
            return null;
        }

        @ApiOperation(path = "/age", verbs = ApiVerb.GET, description = "a-test-method", responseStatusCode = "204")
        @ApiResponseBodyType
        public Integer age(@ApiPathParam(name = "age") Integer age, @ApiRequestBodyType Integer body) {
            return null;
        }

        @ApiOperation(path = "/avg", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public Long avg(@ApiPathParam(name = "avg") Long avg, @ApiRequestBodyType Long body) {
            return null;
        }

        @ApiOperation(path = "/map", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public Map<String, Integer> map(@ApiPathParam(name = "map") Map<String, Integer> map,
                @ApiRequestBodyType Map<String, Integer> body) {
            return null;
        }

        @SuppressWarnings("rawtypes")
        @ApiOperation(path = "/unparametrizedList", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public List unparametrizedList(@ApiPathParam(name = "unparametrizedList") List unparametrizedList,
                @ApiRequestBodyType List body) {
            return null;
        }

        @ApiOperation(path = "/parametrizedList", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public List<String> parametrizedList(@ApiPathParam(name = "parametrizedList") List<String> parametrizedList,
                @ApiRequestBodyType List<String> body) {
            return null;
        }

        @ApiOperation(path = "/wildcardParametrizedList", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public List<?> wildcardParametrizedList(
                @ApiPathParam(name = "wildcardParametrizedList") List<?> wildcardParametrizedList,
                @ApiRequestBodyType List<?> body) {
            return null;
        }

        @ApiOperation(path = "/LongArray", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public Long[] longObjArray(@ApiPathParam(name = "LongArray") Long[] longObjArray,
                @ApiRequestBodyType Long[] body) {
            return null;
        }

        @ApiOperation(path = "/longArray", verbs = ApiVerb.GET, description = "a-test-method")
        @ApiResponseBodyType
        public long[] longArray(@ApiPathParam(name = "longArray") long[] longArray, @ApiRequestBodyType long[] body) {
            return null;
        }

        @ApiOperation(path = "/version", verbs = ApiVerb.GET, description = "a-test-method for api version feature")
        @ApiVersion(since = "1.0", until = "2.12")
        @ApiResponseBodyType
        public String version(@ApiPathParam(name = "version") String version, @ApiRequestBodyType String body) {
            return null;
        }

        @ApiOperation(path = "/child", description = "A method returning a child", verbs = ApiVerb.GET)
        @ApiResponseBodyType
        public Child child(@ApiPathParam(name = "child") Child child, @ApiRequestBodyType Child body) {
            return null;
        }

        @ApiOperation(path = "/pizza", description = "A method returning a pizza", verbs = ApiVerb.GET)
        @ApiResponseBodyType
        public Pizza pizza(@ApiPathParam(name = "pizza") Pizza pizza, @ApiRequestBodyType Pizza body) {
            return null;
        }

        @ApiOperation(path = "/multiple-request-methods",
                verbs = {ApiVerb.GET, ApiVerb.POST},
                description = "a-test-method-with-multiple-request-methods")
        @ApiResponseBodyType
        public Integer multipleRequestMethods(
                @ApiPathParam(name = "multiple-request-methods") Integer multipleRequestMethods,
                @ApiRequestBodyType Integer body) {
            return null;
        }

    }

    @Test
    public void testApiErrorsDoc() {
        ApiDoc apiDoc = buildDoc(Test3Controller.class);

        List<ApiOperationDoc> methods = apiDoc.getOperations();
        ApiOperationDoc apiOperationDoc = methods.get(0);
        List<ApiErrorDoc> apiErrors = apiOperationDoc.getApiErrors();

        assertEquals(1, methods.size());
        assertEquals(3, apiErrors.size());
        assertEquals("1000", apiErrors.get(0).getCode());
        assertEquals("method-level annotation should be applied", "A test error #1", apiErrors.get(0).getDescription());
        assertEquals("2000", apiErrors.get(1).getCode());
        assertEquals("400", apiErrors.get(2).getCode());

    }

    @Test
    public void testGeneral() {
        ApiDoc apiDoc = buildDoc(TestController.class);
        assertEquals("test-controller", apiDoc.getName());
        assertEquals("a-test-controller", apiDoc.getDescription());
        assertEquals("1.0", apiDoc.getSupportedVersions().getSince());
        assertEquals("2.12", apiDoc.getSupportedVersions().getUntil());
        assertEquals(AuthType.NONE, apiDoc.getAuth().getType());
        assertEquals(ApiAuthDocReader.ANONYMOUS, apiDoc.getAuth().getRoles().get(0));

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {

            if (apiOperationDoc.getPaths().contains("/name")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("String", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("String", apiOperationDoc.getRequestBody().getType().getOneLineText());
                assertEquals("200 - OK", apiOperationDoc.getResponseStatusCode());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("name")) {
                        assertEquals("String", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/age")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("204", apiOperationDoc.getResponseStatusCode());
                assertEquals("Integer", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("Integer", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("age")) {
                        assertEquals("Integer", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/avg")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("Long", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("Long", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("avg")) {
                        assertEquals("Long", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/map")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("Map<String, Integer>", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("Map<String, Integer>", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("Map")) {
                        assertEquals("Map<String, Integer>", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/parametrizedList")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("List<String>", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("List<String>", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("parametrizedList")) {
                        assertEquals("List<String>", paramDoc.getType().getOneLineText());
                    }
                }

            }

            if (apiOperationDoc.getPaths().contains("/wildcardParametrizedList")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("List<?>", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("List<?>", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("wildcardParametrizedList")) {
                        assertEquals("List<?>", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/LongArray")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("Long[]", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("Long[]", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("LongArray")) {
                        assertEquals("Long[]", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/longArray")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("long[]", apiOperationDoc.getResponseBodyType().getOneLineText());
                assertEquals("long[]", apiOperationDoc.getRequestBody().getType().getOneLineText());
                for (ParamDoc paramDoc : apiOperationDoc.getPathParameters()) {
                    if (paramDoc.getName().equals("longArray")) {
                        assertEquals("long[]", paramDoc.getType().getOneLineText());
                    }
                }
            }

            if (apiOperationDoc.getPaths().contains("/version")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("1.0", apiOperationDoc.getSupportedVersions().getSince());
                assertEquals("2.12", apiOperationDoc.getSupportedVersions().getUntil());
            }

            if (apiOperationDoc.getPaths().contains("/child")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("child", apiOperationDoc.getResponseBodyType().getOneLineText());
            }

            if (apiOperationDoc.getPaths().contains("/pizza")) {
                assertEquals(ApiVerb.GET, apiOperationDoc.getVerbs().iterator().next());
                assertEquals("customPizzaObject", apiOperationDoc.getResponseBodyType().getOneLineText());
            }

            if (apiOperationDoc.getPaths().contains("/multiple-request-methods")) {
                assertEquals(2, apiOperationDoc.getVerbs().size());
                Iterator<ApiVerb> iterator = apiOperationDoc.getVerbs().iterator();
                assertEquals(ApiVerb.GET, iterator.next());
                assertEquals(ApiVerb.POST, iterator.next());
            }

        }
    }

    @SuppressWarnings("unused")
    @Api(name = "test-controller-with-basic-auth", description = "a-test-controller with basic auth annotation")
    @ApiAuthBasic(roles = {"ROLE_USER", "ROLE_ADMIN"},
            testUsers = {@ApiAuthBasicUser(username = "test-username", password = "test-password")})
    private class TestControllerWithBasicAuth {

        @ApiOperation(path = "/basicAuth", description = "A method with basic auth", verbs = ApiVerb.GET)
        @ApiAuthBasic(roles = {"ROLE_USER"},
                testUsers = {@ApiAuthBasicUser(username = "test-username", password = "test-password")})
        public String basicAuth() {
            return null;
        }

        @ApiOperation(path = "/noAuth", description = "A method with no auth", verbs = ApiVerb.GET)
        @ApiAuthNone
        public String noAuth() {
            return null;
        }

        @ApiOperation(path = "/undefinedAuthWithAuthOnClass",
                description = "A method with undefined auth but with auth info on class declaration",
                verbs = ApiVerb.GET)
        public String undefinedAuthWithAuthOnClass() {
            return null;
        }

    }

    @Test
    public void testControllerWithBasicAuth() {
        ApiDoc apiDoc = buildDoc(TestControllerWithBasicAuth.class);
        assertEquals("test-controller-with-basic-auth", apiDoc.getName());
        assertEquals(AuthType.BASIC_AUTH, apiDoc.getAuth().getType());
        assertEquals("ROLE_USER", apiDoc.getAuth().getRoles().get(0));
        assertEquals("ROLE_ADMIN", apiDoc.getAuth().getRoles().get(1));
        assertTrue(apiDoc.getAuth().getTestusers().size() > 0);

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/basicAuth")) {
                assertEquals(AuthType.BASIC_AUTH, apiOperationDoc.getAuth().getType());
                assertEquals("ROLE_USER", apiOperationDoc.getAuth().getRoles().get(0));
                assertTrue(apiOperationDoc.getAuth().getTestusers().size() > 0);
            }

            if (apiOperationDoc.getPaths().contains("/noAuth")) {
                assertEquals(AuthType.NONE, apiOperationDoc.getAuth().getType());
                assertEquals(ApiAuthDocReader.ANONYMOUS, apiOperationDoc.getAuth().getRoles().get(0));
            }

            if (apiOperationDoc.getPaths().contains("/undefinedAuthWithAuthOnClass")) {
                assertEquals(AuthType.BASIC_AUTH, apiOperationDoc.getAuth().getType());
                assertEquals("ROLE_USER", apiOperationDoc.getAuth().getRoles().get(0));
                assertEquals("ROLE_ADMIN", apiOperationDoc.getAuth().getRoles().get(1));
            }

        }
    }

    @SuppressWarnings("unused")
    @Api(name = "test-token-auth", description = "Test token auth")
    @ApiAuthToken(roles = {""}, testTokens = {"abc", "cde"})
    private class TestControllerWithAuthToken {

        @ApiOperation(path = "/inherit")
        public void inherit() {

        }

        @ApiOperation(path = "/override")
        @ApiAuthToken(roles = {""}, scheme = "Bearer", testTokens = {"xyz"})
        public void override() {

        }

    }

    @Test
    public void testApiAuthToken() {
        ApiDoc apiDoc = buildDoc(TestControllerWithAuthToken.class);
        assertEquals(AuthType.TOKEN, apiDoc.getAuth().getType());
        assertNull(apiDoc.getAuth().getScheme());
        assertEquals("abc", apiDoc.getAuth().getTesttokens().iterator().next());

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/inherit")) {
                assertEquals(AuthType.TOKEN, apiOperationDoc.getAuth().getType());
                assertNull(apiOperationDoc.getAuth().getScheme());
                assertEquals("abc", apiOperationDoc.getAuth().getTesttokens().iterator().next());
            }
            if (apiOperationDoc.getPaths().contains("/override")) {
                assertEquals(AuthType.TOKEN, apiOperationDoc.getAuth().getType());
                assertEquals("Bearer", apiOperationDoc.getAuth().getScheme());
                assertEquals("xyz", apiOperationDoc.getAuth().getTesttokens().iterator().next());
            }
        }

    }

    @SuppressWarnings("unused")
    @Api(name = "test-controller-with-no-auth-annotation", description = "a-test-controller with no auth annotation")
    private class TestControllerWithNoAuthAnnotation {

        @ApiOperation(path = "/basicAuth", description = "A method with basic auth", verbs = ApiVerb.GET)
        @ApiAuthBasic(roles = {"ROLE_USER"},
                testUsers = {@ApiAuthBasicUser(username = "test-username", password = "test-password")})
        public String basicAuth() {
            return null;
        }

        @ApiOperation(path = "/noAuth", description = "A method with no auth", verbs = ApiVerb.GET)
        @ApiAuthNone
        public String noAuth() {
            return null;
        }

        @ApiOperation(path = "/undefinedAuthWithoutAuthOnClass",
                description = "A method with undefined auth and without auth info on class declaration",
                verbs = ApiVerb.GET)
        public String undefinedAuthWithoutAuthOnClass() {
            return null;
        }

    }

    @Test
    public void testControllerWithNoAuthAnnotation() {
        ApiDoc apiDoc = buildDoc(TestControllerWithNoAuthAnnotation.class);
        assertEquals("test-controller-with-no-auth-annotation", apiDoc.getName());
        assertNull(apiDoc.getAuth());

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/basicAuth")) {
                assertEquals(AuthType.BASIC_AUTH, apiOperationDoc.getAuth().getType());
                assertEquals("ROLE_USER", apiOperationDoc.getAuth().getRoles().get(0));
                assertTrue(apiOperationDoc.getAuth().getTestusers().size() > 0);
            }

            if (apiOperationDoc.getPaths().contains("/noAuth")) {
                assertEquals(AuthType.NONE, apiOperationDoc.getAuth().getType());
                assertEquals(ApiAuthDocReader.ANONYMOUS, apiOperationDoc.getAuth().getRoles().get(0));
            }

            if (apiOperationDoc.getPaths().contains("/undefinedAuthWithoutAuthOnClass")) {
                assertNull(apiOperationDoc.getAuth());
            }

        }
    }

    @SuppressWarnings("unused")
    @Api(name = "test-old-style-servlets", description = "a-test-old-style-servlet")
    private class TestOldStyleServlets {

        @ApiOperation(path = "/oldStyle", description = "A method params on method level", verbs = ApiVerb.GET)
        @ApiParams(pathParams = {@ApiPathParam(name = "name", type = String.class)})
        public String oldStyle() {
            return null;
        }

        @ApiOperation(path = "/oldStyleWithList", description = "A method params on method level", verbs = ApiVerb.GET)
        @ApiParams(pathParams = {@ApiPathParam(name = "name", type = List.class)})
        public String oldStyleWithList() {
            return null;
        }

        @ApiOperation(path = "/oldStyleWithMap", description = "A method params on method level", verbs = ApiVerb.GET)
        @ApiParams(pathParams = {@ApiPathParam(name = "name", type = Map.class)})
        public String oldStyleWithMap() {
            return null;
        }

        @ApiOperation(path = "/oldStyleMixed", description = "A method params on method level", verbs = ApiVerb.GET)
        @ApiParams(//
                pathParams = {
                        @ApiPathParam(name = "name", type = String.class),
                        @ApiPathParam(name = "age", type = Integer.class),
                        @ApiPathParam(name = "undefined")
                }, //
                queryParams = {
                        @ApiQueryParam(name = "q", type = String.class, defaultValue = "qTest")
                })
        public String oldStyleMixed(@ApiPathParam(name = "age") Integer age) {
            return null;
        }

        @ApiOperation(path = "/oldStyleResponseObject",
                description = "A method with populated ApiResponseBodyType annotation",
                verbs = ApiVerb.GET)
        @ApiResponseBodyType(List.class)
        public void oldStyleResponseObject() {
        }

        @ApiOperation(path = "/oldStyleBodyObject",
                description = "A method with populated ApiRequestBodyType annotation",
                verbs = ApiVerb.GET)
        @ApiRequestBodyType(List.class)
        public void oldStyleBodyObject() {
        }

    }

    @Test
    public void testOldStyleServlets() {
        ApiDoc apiDoc = buildDoc(TestOldStyleServlets.class);
        assertEquals("test-old-style-servlets", apiDoc.getName());

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/oldStyle")) {
                assertEquals(1, apiOperationDoc.getPathParameters().size());
            }

            if (apiOperationDoc.getPaths().contains("/oldStyleWithList")) {
                assertEquals(1, apiOperationDoc.getPathParameters().size());
            }

            if (apiOperationDoc.getPaths().contains("/oldStyleWithMap")) {
                assertEquals(1, apiOperationDoc.getPathParameters().size());
            }

            if (apiOperationDoc.getPaths().contains("/oldStyleMixed")) {
                assertEquals(3, apiOperationDoc.getPathParameters().size());
                assertEquals(1, apiOperationDoc.getQueryParameters().size());
                assertEquals("qTest", apiOperationDoc.getQueryParameters().iterator().next().getDefaultValue());
            }

            if (apiOperationDoc.getPaths().contains("/oldStyleResponseObject")) {
                assertEquals("List", apiOperationDoc.getResponseBodyType().getOneLineText());
            }

            if (apiOperationDoc.getPaths().contains("/oldStyleBodyObject")) {
                assertEquals("List", apiOperationDoc.getRequestBody().getType().getOneLineText());
            }
        }
    }

    @SuppressWarnings("unused")
    @Api(name = "test-errors-warnings-hints", description = "a-test-for-incomplete-documentation")
    private class TestErrorsAndWarningsAndHints {

        @ApiOperation
        public String oldStyle() {
            return null;
        }
    }

    @Test
    public void testErrorsAndWarningsAndHints() {
        ApiDoc apiDoc = buildDoc(TestErrorsAndWarningsAndHints.class);
        assertEquals("test-errors-warnings-hints", apiDoc.getName());
        ApiOperationDoc apiOperationDoc = apiDoc.getOperations().iterator().next();
        assertEquals(1, apiOperationDoc.getJsondocErrors().size());
        assertEquals(1, apiOperationDoc.getJsondocWarnings().size());
        assertEquals(2, apiOperationDoc.getJsondocHints().size());
    }

    @SuppressWarnings("unused")
    @Api(name = "test-errors-warnings-hints-method-display-as-summary",
            description = "a-test-for-incomplete-documentation-for-method-display-summary")
    private class TestErrorsAndWarningsAndHintsMethodSummary {

        @ApiOperation
        public String summary() {
            return null;
        }
    }

    @Test
    public void testErrorsAndWarningsAnsHintsSummary() {
        ApiDoc apiDoc = buildDoc(TestErrorsAndWarningsAndHintsMethodSummary.class);
        ApiOperationDoc apiOperationDoc = apiDoc.getOperations().iterator().next();
        assertEquals(1, apiOperationDoc.getJsondocErrors().size());
        assertEquals(1, apiOperationDoc.getJsondocWarnings().size());
        assertEquals(2, apiOperationDoc.getJsondocHints().size());
    }

    @SuppressWarnings("unused")
    @Api(description = "An interface controller", name = "interface-controller")
    private interface InterfaceController {

        @ApiOperation(path = "/interface", verbs = ApiVerb.GET)
        String inter();
    }

    @SuppressWarnings("unused")
    private class InterfaceControllerImpl implements InterfaceController {

        @Override
        public String inter() {
            return null;
        }

    }

    @Test
    public void testInterfaceController() {
        ApiDoc apiDoc;
        ApiOperationDoc apiOperationDoc;
        apiDoc = buildDoc(InterfaceController.class);
        assertEquals("interface-controller", apiDoc.getName());
        apiOperationDoc = apiDoc.getOperations().iterator().next();
        Assert.assertNotNull(apiOperationDoc);
        assertEquals("/interface", apiOperationDoc.getPaths().iterator().next());
    }

    @SuppressWarnings("unused")
    @Api(name = "test-declared-methods", description = "a-test-for-declared-methods")
    private class TestDeclaredMethods {

        @ApiOperation(path = "/protectedMethod")
        protected String protectedMethod() {
            return null;
        }

        @ApiOperation(path = "/privateMethod")
        private String privateMethod() {
            return null;
        }
    }

    @Test
    public void testDeclaredMethods() {
        ApiDoc apiDoc;
        apiDoc = buildDoc(TestDeclaredMethods.class);
        assertEquals("test-declared-methods", apiDoc.getName());
        assertEquals(2, apiDoc.getOperations().size());
    }

    @SuppressWarnings("unused")
    @Api(name = "ISSUE-110", description = "ISSUE-110")
    private class TestMultipleParamsWithSameMethod {

        @ApiOperation(id = "search-by-title", path = "/search", description = "search one by title")
        @ApiResponseBodyType
        public List findByTitle(@ApiQueryParam(name = "title") String title) {
            return null;
        }

        @ApiOperation(id = "search-by-content", path = "/search", description = "search one by content")
        @ApiResponseBodyType
        public List findByContent(@ApiQueryParam(name = "content") String content) {
            return null;
        }

        @ApiOperation(path = "/search", description = "search one by content and field")
        @ApiResponseBodyType
        public List findByContent(@ApiQueryParam(name = "content") String content,
                @ApiQueryParam(name = "field") String field) {
            return null;
        }
    }

    @Test
    public void testMultipleParamsSameMethod() {
        ApiDoc apiDoc = buildDoc(TestMultipleParamsWithSameMethod.class);
        assertEquals(3, apiDoc.getOperations().size());
    }

    @SuppressWarnings("unused")
    @Api(description = "ApiHeadersController", name = "ApiHeadersController")
    @ApiHeaders(headers = {
            @ApiHeader(name = "H1", description = "h1-description"),
            @ApiHeader(name = "H2", description = "h2-description")
    })
    private class ApiHeadersController {

        @ApiOperation(path = "/api-headers-controller-method-one")
        public void apiHeadersMethodOne() {
        }

        @ApiOperation(path = "/api-headers-controller-method-two")
        @ApiHeaders(headers = {
                @ApiHeader(name = "H4", description = "h4-description"),
                // duplicate H1 should be ignored (already on class level)
                @ApiHeader(name = "H1", description = "h1-description")
        })
        public void apiHeadersMethodTwo() {
        }
    }

    @Test
    public void testApiHeadersOnClass() {
        ApiDoc apiDoc = buildDoc(ApiHeadersController.class);
        assertEquals("ApiHeadersController", apiDoc.getName());
        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/api-headers-controller-method-one")) {
                assertEquals(2, apiOperationDoc.getHeaders().size());
            }
            if (apiOperationDoc.getPaths().contains("/api-headers-controller-method-two")) {
                assertEquals(3, apiOperationDoc.getHeaders().size());
            }
        }
    }

    @SuppressWarnings("unused")
    @Api(name = "test-path", description = "test-path")
    private class ControllerWithMethodPaths {

        @ApiOperation(path = {"/path1", "/path2"})
        public void path() {
        }
    }

    @Test
    public void testPaths() {
        ApiDoc apiDoc = buildDoc(ControllerWithMethodPaths.class);

        assertEquals(1, apiDoc.getOperations().size());
        assertTrue(apiDoc.getOperations().get(0).getPaths().containsAll(Arrays.asList("/path1", "/path2")));
    }

    @SuppressWarnings("unused")
    @Api(name = "test-type-level-stage", description = "Test type level stage attributes")
    @ApiStage(Stage.BETA)
    private class ControllerWithStage {

        @ApiOperation(path = "/inherit")
        public void inherit() {
        }

        @ApiOperation(path = "/override")
        @ApiStage(Stage.GA)
        public void override() {
        }
    }

    @Test
    public void testApiStage_typeLevel() {
        ApiDoc apiDoc = buildDoc(ControllerWithStage.class);
        assertEquals(Stage.BETA, apiDoc.getStage());

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/inherit")) {
                assertEquals(Stage.BETA, apiOperationDoc.getStage());
            }
            if (apiOperationDoc.getPaths().contains("/override")) {
                assertEquals(Stage.GA, apiOperationDoc.getStage());
            }
        }
    }

    @SuppressWarnings("unused")
    @Api(name = "test-method-level-stage", description = "Test method level stage attributes")
    private class ControllerWithMethodStage {

        @ApiOperation(path = "/only-method")
        @ApiStage(Stage.DEPRECATED)
        public void testStage() {
        }
    }

    @Test
    public void testApiStage_methodLevel() {
        ApiDoc apiDoc = buildDoc(ControllerWithMethodStage.class);
        assertNull(apiDoc.getStage());

        for (ApiOperationDoc apiOperationDoc : apiDoc.getOperations()) {
            if (apiOperationDoc.getPaths().contains("/only-method")) {
                assertEquals(Stage.DEPRECATED, apiOperationDoc.getStage());
            }
        }
    }

    private static ApiDoc buildDoc(Class<?> controller) {
        LivedocReader reader = LivedocReader.basicAnnotationReader(new LivedocConfiguration(Collections.emptyList()));
        Optional<ApiDoc> apiDoc = reader.readApiDoc(controller);
        assertTrue(apiDoc.isPresent());
        return apiDoc.get();
    }
}


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\AlbumSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'ID') ?>

    <?= $form->field($model, 'Name') ?>

    <?= $form->field($model, 'About') ?>

    <?= $form->field($model, 'Date') ?>

    <?= $form->field($model, 'CategoryPhotoID') ?>

    <?php // echo $form->field($model, 'SubcategoryPhotoID') ?>

    <?php // echo $form->field($model, 'Cover') ?>

        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>