using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace HeIsBad.Dbl.Models
{
/// <summary>
/// Причина жалобы
/// </summary>
[Table("blamereasons")]
public class DbBlameReason
{
/// <summary>
/// Идентификатор
/// </summary>
[Key]
public int Id { get; set; }
/// <summary>
/// Имя
/// </summary>
[Required]
public string Name { get; set; }
/// <summary>
/// Описание
/// </summary>
public string Description { get; set; }
}
}
$data = array("name" => "Hagrid", "age" => "36");
$data_string = json_encode($data);
$ch = curl_init('http://api.local/rest/users');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data_string))
);
$result = curl_exec($ch);
curl --header "Content-Type: application/json" \
--request POST \
--data '{"username":"xyz","password":"xyz"}' \
http://localhost:3000/api/login
options:[
{id: 4, type:'simple', total: 1000, name: 'simple' },
{id: 5, type:'select', total: 5000, name: 'select'}
{id: 6, type:'select', total: 1000 , name: 'select'}
]
<li v-for="opt in options" class="opt">
<SimpleCell v-if="opt.type === 'simple'" :item="opt"/>
<SelectCell v-else-if="opt.type === 'select'" :item="opt" />
<DefaultCell v-else :name="opt.name" :total='opt.total' />
Для прикладного уровня я достаточно сказал, а если дальше разбираться то всегда есть RFC